#include #ifdef __AVR__ #include #endif #define PIN 19 Adafruit_NeoPixel strip = Adafruit_NeoPixel(3, PIN, NEO_GRB + NEO_KHZ800); int ledR = 0; int ledG = 0; int ledB = 0; int pixelBrightness = 50; int Mode = 0, j = 0, Speed = 20; void setup() { // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket #if defined (__AVR_ATtiny85__) if (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif // End of trinket special code Serial.begin(9600); strip.begin(); strip.show(); // Initialize all pixels to 'off' } void loop(){ if(Serial.available()>0){ int input = Serial.read(); if(input == 1 ){ colorWipe(strip.Color(255, 0, 0), 0); // Red } else if (input ==2){ colorWipe(strip.Color(0, 255, 0), 0); // Green } else if(input ==3){ colorWipe(strip.Color(0, 0, 255), 0); // Blue } strip.show(); }} // Fill the dots one after the other with a color void colorWipe(uint32_t c, uint8_t wait) { for(uint16_t i=0; i