From 039c6958d279d6a17fcc9df8444ab279cac76ac4 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Fri, 19 Dec 2025 13:19:22 -0700 Subject: [PATCH] feat: Add NeoPixel demo --- demos/neopixel/neopixel.ino | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 demos/neopixel/neopixel.ino diff --git a/demos/neopixel/neopixel.ino b/demos/neopixel/neopixel.ino new file mode 100644 index 0000000..1f4c732 --- /dev/null +++ b/demos/neopixel/neopixel.ino @@ -0,0 +1,35 @@ + +#include // version 1.15.2 + + +#define PIN 18 +#define NUMPIXELS 1 + +// When setting up the NeoPixel library, we tell it how many pixels, +// and which pin to use to send signals. Note that for older NeoPixel +// strips you might need to change the third parameter -- see the +// strandtest example for more information on possible values. +Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); + +#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels + +void setup() { + pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) +} + +void loop() { + pixels.clear(); // Set all pixel colors to 'off' + + // The first NeoPixel in a strand is #0, second is 1, all the way up + // to the count of pixels minus one. + for(int i=0; i