2024-03-07 14:01:54 +00:00
|
|
|
|
|
|
|
#include <Adafruit_NeoPixel.h>
|
|
|
|
|
2024-03-18 00:49:22 +00:00
|
|
|
#define PIN 15
|
|
|
|
#define NUM 1
|
2024-03-07 14:01:54 +00:00
|
|
|
|
2024-03-17 21:56:41 +00:00
|
|
|
int r = 255;
|
|
|
|
int g = 255;
|
|
|
|
int b = 255;
|
|
|
|
|
|
|
|
//neopixel jewel 7 = NEO_GRBW + NEO_KHZ800
|
|
|
|
//neopixel strips = NEO_GRB + NEO_KHZ800
|
2024-03-18 00:49:22 +00:00
|
|
|
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM, PIN, NEO_GRBW + NEO_KHZ800);
|
2024-03-07 14:01:54 +00:00
|
|
|
|
|
|
|
void setup() {
|
|
|
|
Serial.begin(115200);
|
|
|
|
pixels.begin();
|
2024-03-17 21:56:41 +00:00
|
|
|
pixels.setBrightness(55);
|
|
|
|
for ( int i = 0; i < NUM; i++ ) {
|
|
|
|
pixels.setPixelColor(i, 0, 0, 0);
|
|
|
|
}
|
2024-03-07 14:01:54 +00:00
|
|
|
pixels.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop () {
|
2024-03-17 21:56:41 +00:00
|
|
|
for ( int i = 0; i < NUM; i++ ) {
|
|
|
|
pixels.setPixelColor(i, r, g, b);
|
|
|
|
}
|
|
|
|
pixels.show();
|
|
|
|
delay(300);
|
2024-03-07 14:01:54 +00:00
|
|
|
}
|