// Jeff Ritchie 02.16.2026 Fab Academy Week 4 Embedded Programming v4 //Based on strandtest.ino by adafruit. #include // pin on the Arduino connected to the NeoPixels #define LED_PIN D6 // changed to reflect pinout of RP2040 #define button_PIN D0 //assigned pin for button // # of NeoPixels attached to the Arduino #define LED_COUNT 56 //changed to reflect the number of neopixels in the strand I have bool button_up = true; #define delayvalue 500 //variable for delay time // Declare NeoPixel strip object: Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); void setup() { pinMode(LED_PIN,OUTPUT); pinMode(button_PIN,INPUT_PULLUP); strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) strip.show(); // Turn OFF all pixels ASAP strip.setBrightness(50); // Set BRIGHTNESS to about 1/5 (max = 255) } // loop() function -- runs repeatedly as long as board is on --------------- void loop() { if ((digitalRead(button_PIN)) == HIGH && !button_up) { rainbow(10); // Flowing rainbow cycle along the whole strip button_up = true; } else if ((digitalRead(button_PIN) == LOW) && button_up){ button_up = false; } } // Adafruit progammed functions for creating animated effects ----------------- // Fill strip pixels one after another with a color. Strip is NOT cleared // first; anything there will be covered pixel by pixel. Pass in color // (as a single 'packed' 32-bit value, which you can get by calling // strip.Color(red, green, blue) as shown in the loop() function above), // and a delay time (in milliseconds) between pixels. void colorWipe(uint32_t color, int wait) { for(int i=0; i RGB strip.setPixelColor(c, color); // Set pixel 'c' to value 'color' } strip.show(); // Update strip with new contents delay(wait); // Pause for a moment firstPixelHue += 65536 / 90; // One cycle of color wheel over 90 frames } } }