Difference between revisions of "Lighting the RGB LED"

From Banana Pi Wiki
Jump to: navigation, search
(Created page with "==How to lighting the RGB LED== * Librarys:https://github.com/adafruit/Adafruit_NeoPixel Adafruit_NeoPixel from Adafruit * Download librarys and put it in the libraries...")
(No difference)

Revision as of 04:03, 28 August 2018

How to lighting the RGB LED

  • Download librarys and put it in the libraries folder in the root directory of the Arduino IDE

LightingLED-1.png

  • Open Arduino IDE

click 'file'->'Example'->'Adafruit NeoPixel'->'simple' to open the example

LightingLED-2.png

We need to change some code,Find the code below in the code

 #define PIN            6
 #define NUMPIXELS      16

change to

 #define PIN            4
 #define NUMPIXELS      25
 #define LED_POWER      2

Then add the following code to void setup()

  pinMode(LED_POWER, OUTPUT);
  digitalWrite(LED_POWER, HIGH);

Compile this program

LightingLED-3.png

And download it(Set the serial port and board)