LedThing.ino 833 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "FastLED.h"
  2. #define NUM_LEDS 50
  3. #define DATA_PIN 9
  4. CRGB leds[NUM_LEDS];
  5. void setup() {
  6. // put your setup code here, to run once:
  7. //Serial.begin(9600);
  8. //pinMode(DATA_PIN, OUTPUT);
  9. delay(3000);
  10. FastLED.addLeds<TM1804, DATA_PIN, BRG>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
  11. FastLED.setBrightness(255);
  12. FastLED.clear();
  13. FastLED.show();
  14. delay(1000);
  15. }
  16. void loop() {
  17. // put your main code here, to run repeatedly:
  18. //Serial.println("Hello");
  19. //delay(1000);
  20. // leds[3] = CRGB::Blue;
  21. // leds[0] = CRGB::Red;
  22. // leds[1] = CRGB::Green;
  23. // leds[49] = CRGB::White;
  24. FastLED.clear();
  25. FastLED.show();
  26. uint8_t delta = 10;
  27. for (uint8_t i = 0; i < 360; i++) {
  28. //leds[i] = CRGB(255-i*4, 255-i*4, 255-i*4);
  29. fill_rainbow(leds, NUM_LEDS, i, delta);
  30. FastLED.show();
  31. delay(10);
  32. }
  33. }