Skip to content

Instantly share code, notes, and snippets.

@sottam
Created February 28, 2020 22:15
Show Gist options
  • Save sottam/b24294815eda36fcd02a5293f2172cb7 to your computer and use it in GitHub Desktop.
Save sottam/b24294815eda36fcd02a5293f2172cb7 to your computer and use it in GitHub Desktop.
#include <Arduino.h>
#include <FastLED.h>
//DIGITAL STRIP SIDES
// #define DATA_PIN 22
// #define CLK_PIN 23
//DIGITAL STRIP SIDES
#define DATA_PIN 8
#define CLK_PIN 9
#define LED_TYPE P9813
#define COLOR_ORDER RGB
#define NUM_LEDS 3
#define BRIGHTNESS 128
// Define the array of leds
CRGB leds[NUM_LEDS];
CRGB colors[] = { CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::Green, CRGB:: Cyan, CRGB:: Blue, CRGB::Magenta };
void setup() {
FastLED.addLeds<LED_TYPE, DATA_PIN, CLK_PIN, COLOR_ORDER>(leds, NUM_LEDS);
}
int atual = 0;
int maximo = 6;
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = colors[atual];
leds[1] = colors[atual];
leds[2] = colors[atual];
FastLED.show();
atual++;
atual = atual % 7;
Serial.println(atual);
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment