/**
* Blink the onboard NeoPixel RGB LED using the Adafruit NeoPixel library.
* Works on any Adafruit Feather with a built-in NeoPixel.
*
* Requires the Adafruit NeoPixel library:
* Sketch -> Include Library -> Manage Libraries -> search "Adafruit NeoPixel"
*
* By Jon E. Froehlich
* @jonfroehlich | https://jonfroehlich.github.io/
* https://makeabilitylab.github.io/physcomp/esp32/led-blink
*/
#include <Adafruit_NeoPixel.h>
// On the Wokwi generic ESP32-S3 DevKit, the NeoPixel is on GPIO 38
const int WOKWI_NEOPIXEL_PIN = 38;
// Initialize the NeoPixel object
Adafruit_NeoPixel _pixel(1, WOKWI_NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800);
// Blink delay
const int BLINK_DELAY_MS = 500;
void setup() {
_pixel.begin();
_pixel.setBrightness(30); // 0-255; keep it low to avoid blinding yourself!
}
void loop() {
_pixel.setPixelColor(0, _pixel.Color(255, 0, 0)); // Red
_pixel.show();
delay(BLINK_DELAY_MS);
_pixel.setPixelColor(0, _pixel.Color(0, 0, 0)); // Off
_pixel.show();
delay(BLINK_DELAY_MS);
_pixel.setPixelColor(0, _pixel.Color(0, 255, 0)); // Green
_pixel.show();
delay(BLINK_DELAY_MS);
_pixel.setPixelColor(0, _pixel.Color(0, 0, 0)); // Off
_pixel.show();
delay(BLINK_DELAY_MS);
_pixel.setPixelColor(0, _pixel.Color(0, 0, 255)); // Blue
_pixel.show();
delay(BLINK_DELAY_MS);
_pixel.setPixelColor(0, _pixel.Color(0, 0, 0)); // Off
_pixel.show();
delay(BLINK_DELAY_MS);
}Loading
esp32-s3-devkitc-1
esp32-s3-devkitc-1