Looking at the LED and LED.RGB API
We took a brief look at the LED API in Johnny-Five in the last chapter, but in this chapter, we will delve deeper and talk about the PWM output and the cousin of the standard LED, the RGB LED—so named because it has a red, green, and blue channel, and can replicate thousands of colors. We will use an RGB LED, as well as some of the more powerful tools built into Johnny-Five, to build an interactive project in this chapter.
The LED object
The LED object is usually the first thing in Johnny-Five that people look through the documentation for. It's also a great object to use to outline the general structure of the object documentation. Let's take a look at each section and get a grasp of where we should look for what later:
- Parameters: This section addresses the parameters that need to be passed into the object constructor, and what form they need to be in (order, object key, and so on).
- Shapes:Â These are the fields attached to the constructed object that may...