#include <Adafruit_NeoPixel.h>
#define PIN 8 // ESP32-H2 built-in RGB LED
#define NUMPIXELS 1 // Assuming a single RGB LED
Adafruit_NeoPixel pixels (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define USER_LED_PIN 13
#define DELAYVAL 500 // milliseconds
void setup() {
Serial.begin(115200);
pixels.begin(); // Initialize NeoPixel library
pixels.clear(); // Clear any existing data on the LED
pinMode(USER_LED_PIN, OUTPUT);
}
void loop() {
Serial.println("Hello, ESP32-H2!");
// Set color to red
pixels.setPixelColor(0, pixels.Color(255, 0, 0));
pixels.show(); // Send the updated color data to the LED
digitalWrite(USER_LED_PIN, HIGH);
delay(DELAYVAL);
// Set color to green
pixels.setPixelColor(0, pixels.Color(0, 255, 0));
pixels.show();
delay(DELAYVAL);
// Set color to blue
pixels.setPixelColor(0, pixels.Color(0, 0, 255));
pixels.show();
delay(DELAYVAL);
//Set color to white (R+G+B)
pixels.setPixelColor(0, pixels.Color(255, 255, 255));
pixels.show();
delay(DELAYVAL);
//Set color to purple (R+B)
pixels.setPixelColor(0, pixels.Color(255, 0, 255));
pixels.show();
delay(DELAYVAL);
//Set color to yellow (R+G)
pixels.setPixelColor(0, pixels.Color(255, 255, 0));
pixels.show();
delay(DELAYVAL);
//Set color to cyan (G+B)
pixels.setPixelColor(0, pixels.Color(0, 255, 255));
pixels.show();
delay(DELAYVAL);
// Turn off the LED
pixels.setPixelColor(0, pixels.Color(0, 0, 0));
pixels.show();
digitalWrite(USER_LED_PIN, LOW);
delay(DELAYVAL);
}
Board not found
board-aitewinrobot-esp32h2-supermini
board-aitewinrobot-esp32h2-supermini