Smart Home Automation Forum

Full Version: [Arduino IDE demo source code for KC868-SERVER]--#05-WS2812B LED_code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[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
[attachment=936]
[attachment=937]
[attachment=938]