#include "FastLED.h" // dvb for Jordan's Hexagram dj lighter-upper // uses 198 WS2801 leds // WHITE:DATA // GREEN:CLOCK // RED:POWER +5 // BLUE:GND 0 #define NUM_LEDS 200 // Data pin that led data will be written out over #define DATA_PIN 6 // Clock pin only needed for SPI based chipsets when not using hardware SPI #define CLOCK_PIN 7 // This is an array of leds. One item for each led in your strip. CRGB leds[NUM_LEDS]; // This function sets up the ledsand tells the controller about them void setup() { // sanity check delay - allows reprogramming if accidently blowing power w/leds delay(2000); Serial.begin(115200); Serial.print("hello\n"); FastLED.addLeds(leds, NUM_LEDS); for(int ix = 0; ix < NUM_LEDS; ix++) leds[ix] = CRGB::Black; } static const char zz[] = { 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , 0,1,2,3,4,5,6,7,8,9 , }; void pf(const char *s, int x) { Serial.print(s); Serial.print(x); Serial.print("\n\r"); } int ticks = 0; int k = 0; float hue = 0; void loop() { delay(10); ticks++; int ch = Serial.read(); if(ch != -1) pf("ch is ", ch); int d = 0; switch(ch) { case '.': d = +1; bump: k = (k + d + NUM_LEDS) % NUM_LEDS; pf("PIXEL: ", k); break; case ',': d = -1; goto bump; case '<': d = -10; goto bump; case '>': d = +10; goto bump; } for(int ix = 0; ix < NUM_LEDS; ix++) leds[ix] = CRGB::Black; leds[k] = CRGB(20,20,20); FastLED.show(); }