Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Arduino IDE demo source code for KC868-SERVER]--#05-WS2812B LED_code
#1
[Arduino IDE demo source code for KC868-SERVER]--#05-WS2812B LED_code
Code:
#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel rgb_display_4 = Adafruit_NeoPixel(5,4,NEO_GRB + NEO_KHZ800);
// LED numbers is 5    led connect to IO4

void setup(){
  rgb_display_4.begin();
}

void loop(){
  rgb_display_4.setPixelColor((1)-1, (0xff0000)); //LED 1 RED
  rgb_display_4.setPixelColor((2)-1, (0x3333ff)); //LED 2 BLUE
  rgb_display_4.setPixelColor((3)-1, (0xffff33)); //LED 3 YELLOW
  rgb_display_4.setPixelColor((4)-1, (0x33ff33)); //LED 4 GREEN
  rgb_display_4.setPixelColor((5)-1, (0xcc33cc)); //LED 5 PURPLE
  rgb_display_4.show();

}
Install "Adafruit_NeoPixel"first
   
   
   
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)