The Led.RGB object

Once you've acquainted yourself with the LED object, click on the Led.RGB link in the sidebar, as shown in the following screenshot:

You'll be taken to the Led.RGB documentation page. In the Component Initialization section, look for the LED RGB PCA9685 section. Ignore the wiring diagram (it's for the Tessel 2, a different microcontroller), but do make a note of the example code, as shown here:

new five.Led.RGB({
controller:
"PCA9685",
pins: {
red:
2,
green:
1,
blue:
0
}
});

This is the code that we will use to initialize our RGB.LED object.

We will also need the API section in order to determine the functions and parameters that we will need for using the RGB.LED object. Take a look at the color() function, in particular. 

Now that we have our module for converting colors into RGB values, we can start talking about how to use an RGB LED in order to get those colors into our projects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.224.226