Got esp32_neopixel working on Uno (I know)
This commit is contained in:
parent
1d76154891
commit
ed42f0ca45
|
@ -1,19 +1,31 @@
|
||||||
|
|
||||||
#include <Adafruit_NeoPixel.h>
|
#include <Adafruit_NeoPixel.h>
|
||||||
|
|
||||||
#define PIN 15
|
#define PIN 6
|
||||||
#define NUM 6
|
#define NUM 6
|
||||||
|
|
||||||
|
int r = 255;
|
||||||
|
int g = 255;
|
||||||
|
int b = 255;
|
||||||
|
|
||||||
|
//neopixel jewel 7 = NEO_GRBW + NEO_KHZ800
|
||||||
|
//neopixel strips = NEO_GRB + NEO_KHZ800
|
||||||
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM, PIN, NEO_GRB + NEO_KHZ800);
|
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUM, PIN, NEO_GRB + NEO_KHZ800);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
pixels.begin();
|
pixels.begin();
|
||||||
pixels.setBrightness(255);
|
pixels.setBrightness(55);
|
||||||
pixels.fill(0xFF0000);
|
for ( int i = 0; i < NUM; i++ ) {
|
||||||
|
pixels.setPixelColor(i, 0, 0, 0);
|
||||||
|
}
|
||||||
pixels.show();
|
pixels.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop () {
|
void loop () {
|
||||||
|
for ( int i = 0; i < NUM; i++ ) {
|
||||||
|
pixels.setPixelColor(i, r, g, b);
|
||||||
|
}
|
||||||
|
pixels.show();
|
||||||
|
delay(300);
|
||||||
}
|
}
|
Loading…
Reference in New Issue