diff --git a/src/main.cpp b/src/main.cpp index 91cca96364454caa5d0a0dddbbf6597a6b6c8743..9066008f56f6104002a02cb6da181015aa5de222 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,10 +1,26 @@ #include <Arduino.h> +#include <Adafruit_NeoPixel.h> + +#define NEOPIXEL_PIN 6 +#define NEOPIXEL_LEN 105 + +Adafruit_NeoPixel pixels(NEOPIXEL_LEN, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800); void setup() { pinMode(LED_BUILTIN, OUTPUT); + pixels.begin(); } +int pos = 0; + void loop() { + for (int i = 0; i < NEOPIXEL_LEN; i++) { + pixels.setPixelColor(i, 0xFFFFFF); + } + pixels.setPixelColor(pos, 0xFF0000); + pixels.show(); + pos = (pos + 1) % NEOPIXEL_LEN; + digitalWrite(LED_BUILTIN, HIGH); delay(500); digitalWrite(LED_BUILTIN, LOW);