For the next project, we're going to look at the
Led object API and test several different methods. This is one of the benefits of Johnny-Five—abstraction. If you can understand the concept of an LED, you can use the Johnny-Five LED object without thinking about the underlying pins or timings. Let's go over the methods that we'll use for our project:
off(): These turn an LED on and off. Under abstraction, this sets the pin that is wired to the LED to
LOW, respectively. We'll be using these in the REPL.
blink(time): This turns an LED on and off at a given interval.
blink()are aliases of each other and do the same thing.
pulse(time): This will cause an LED to pulse on and off in an eased ...