// An example demonstrating how to control the Adafruit Dot Star RGB LED // included on board the ItsyBitsy M4 board. #include // There is only one pixel on the board #define NUMPIXELS 1 //Use these pin definitions for the ItsyBitsy M4 #define DATAPIN 8 #define CLOCKPIN 6 Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG); void setup() { strip.begin(); // Initialize pins for output strip.setBrightness(80); strip.show(); // Turn all LEDs off ASAP } void loop() { rainbow(10); // Flowing rainbow cycle along the whole strip } // Rainbow cycle along whole strip. Pass delay time (in ms) between frames. void rainbow(int wait) { // Hue of first pixel runs 5 complete loops through the color wheel. // Color wheel has a range of 65536 but it's OK if we roll over, so // just count from 0 to 5*65536. Adding 256 to firstPixelHue each time // means we'll make 5*65536/256 = 1280 passes through this outer loop: for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) { for(int i=0; i