/* Author: Elena C. K. Description: Attiny84 to control DotStar LED strip from Adafruit. It only have enough byte to control approximately 32 LEDs. Use the FastLED library to program. IDE Attiny84 Physical Pin 0 PA0 13 1 PA1 12 2 PA2 11 - OPAMP OUT 3 PA3 10 4 PA4 9 5 PA5 8 6 PA6 7 7 PA7 6 - D1 8 PB2 5 - C1 9 PB1 3 10 PB0 2 */ #include #define NUM_LEDS 72 //#define NUM_LEDS 144 #define DATA_PIN 7 #define CLOCK_PIN 8 CRGB leds[NUM_LEDS]; void setup() { // put your setup code here, to run once: FastLED.addLeds(leds, NUM_LEDS); FastLED.clear(); } void loop() { firstLight(); } void threeLED() { // put your main code here, to run repeatedly: for (int i = 0; i < NUM_LEDS - 1; i++) { leds[i] = CRGB::Red; leds[i + 1] = CRGB::Red; FastLED.delay(10); leds[i] = CRGB::Black; leds[i + 1] = CRGB::Black; } } void firstLight() { for (int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) { // Turn our current led on to white, then show the leds leds[whiteLed] = CRGB::White; // Show the leds (only one of which is set to white, from above) FastLED.show(); // Wait a little bit delay(100); // Turn our current led back to black for the next loop around leds[whiteLed] = CRGB::Black; } }