Esp32 neopixel hello world.ino
From Federal Burro of Information
#include <Adafruit_NeoPixel.h> #ifdef __AVR__ #include <avr/power.h> #endif #define PIN 8 #define NUMPIXELS 1 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); #define DELAYVAL 250 void setup() { #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif pixels.begin(); } void loop() { pixels.clear(); for(int i=0; i<NUMPIXELS; i++) { // Colour R G B // Red 255 0 0 // Orange 255 32 0 // Yellow 255 127 0 // Green 0 255 0 // Blue 0 0 255 // Indigo 40 0 255 // Violet 255 0 80 // R G B // Red pixels.setPixelColor(i, pixels.Color(255, 0, 0)); pixels.show(); delay(DELAYVAL); // Orange pixels.setPixelColor(i, pixels.Color(255, 32, 0)); pixels.show(); delay(DELAYVAL); // Yellow pixels.setPixelColor(i, pixels.Color(255, 127, 0)); pixels.show(); delay(DELAYVAL); // Green pixels.setPixelColor(i, pixels.Color(0, 255, 0)); pixels.show(); delay(DELAYVAL); // Blue pixels.setPixelColor(i, pixels.Color(0, 0, 255)); pixels.show(); delay(DELAYVAL); // Indigo pixels.setPixelColor(i, pixels.Color(40, 0, 255)); pixels.show(); delay(DELAYVAL); // Violet pixels.setPixelColor(i, pixels.Color(255, 0, 80)); pixels.show(); delay(DELAYVAL); } }