Bläddra i källkod

Animation works

jediemil 5 år sedan
incheckning
b523df6cd5
1 ändrade filer med 35 tillägg och 0 borttagningar
  1. 35 0
      LedThing.ino

+ 35 - 0
LedThing.ino

@@ -0,0 +1,35 @@
+#include "FastLED.h"
+#define NUM_LEDS 50
+#define DATA_PIN 9
+CRGB leds[NUM_LEDS];
+
+void setup() {
+  // put your setup code here, to run once:
+  //Serial.begin(9600);
+  //pinMode(DATA_PIN, OUTPUT);
+  delay(3000);
+  FastLED.addLeds<TM1804, DATA_PIN, BRG>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
+  FastLED.setBrightness(255);
+  FastLED.clear();
+  FastLED.show();
+  delay(1000);
+}
+
+void loop() {
+  // put your main code here, to run repeatedly:
+  //Serial.println("Hello");
+  //delay(1000);
+//  leds[3] = CRGB::Blue;
+//  leds[0] = CRGB::Red;
+//  leds[1] = CRGB::Green;
+//  leds[49] = CRGB::White;
+  FastLED.clear();
+  FastLED.show();
+  uint8_t delta = 10;
+  for (uint8_t i = 0; i < 360; i++) {
+    //leds[i] = CRGB(255-i*4, 255-i*4, 255-i*4);
+    fill_rainbow(leds, NUM_LEDS, i, delta);
+    FastLED.show();
+    delay(10);
+  }
+}