Controlling our LED from the command-line interface

Move the code over to your Raspberry Pi, and in your SSH session, navigate to your project folder using cd and run your project (be sure to use sudo!):

sudo node rgb-led-repl.js

Then, you can manipulate the RGB LED and the color library to change the light's color. Here are a few things to try:

>> rainbowCycle = false // this stops the rainbow color cycle
>> rgbLED.off() // turns the RGB LED off
>> rgbLED.color(color('rebeccapurple').rgb().array()) // sets the LED purple!
..................Content has been hidden....................

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