Guest User

Arduino UNO Ws2811 RGB problem

a guest
Jul 16th, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include <FastSPI_LED2.h>
  2. #define NUM_LEDS 2
  3.  
  4. CRGB leds[NUM_LEDS];
  5.  
  6. void setup() {
  7.   LEDS.addLeds<WS2811, 11>(leds, NUM_LEDS, GRB);  
  8. }
  9. void loop() {
  10. //
  11. //// This works as aspected, but green and red are not changed
  12. //
  13. //    LEDS.showColor(CRGB(0, 0, 10));
  14. //    delay(1000);
  15. //    LEDS.showColor(CRGB(0, 10, 0));
  16. //    delay(1000);
  17. //    LEDS.showColor(CRGB(10, 0, 0));
  18. //    delay(1000);
  19. //
  20. //// This creates flickering on LED 2 and a blue/green on LED1
  21. //
  22. //      leds[0].g = 20;
  23. //      leds[1].b = 20;
  24. //      LEDS.show();
  25. //
  26. //// Same problem as firs one. (LEDs are green but should be red)
  27. //
  28. LEDS.showColor(CRGB::Red);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment