XIAO-RA4M1
Support
XIAO-RA4M1
Renesas RA4M1
build-in RGB LED
Navigate to File > Preferences, and fill "Additional Boards Manager URLs" with the url below: https://files.seeedstudio.com/arduino/package_renesas_1.2.0_index.json
type the keyword RA4M1
Navigate to File > Examples > 01.Basics > Blink, open the program.
https://github.com/adafruit/Adafruit_NeoPixel.git
Liens externes
https://www.seeedstudio.com/Seeed-XIAO-RA4M1-p-5943.html
https://wiki.seeedstudio.com/getting_started_xiao_ra4m1/
code
Blink
https://wiki.myows.top/index.php?title=Blink_Examples_01-Basics
changer la couleur de la LED entre le rouge, le vert et le bleu
Play with RGB LEDs
LED user allumé
LED RGB change de couleur, mais lumiere très forte
Bibliothèque : https://github.com/adafruit/Adafruit_NeoPixel
#include <Adafruit_NeoPixel.h>
#define LED_PIN RGB_BUILTIN // Define the pin for the built-in RGB LED
#define NUM_PIXELS 1 // Number of WS2812 LEDs
Adafruit_NeoPixel pixels(NUM_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(PIN_RGB_EN, OUTPUT); // Set up the power pin
digitalWrite(PIN_RGB_EN, HIGH); //Turn on power to the LED
pixels.begin(); // Initialize the NeoPixel library
}
void loop() {
// Transition from Red to Green
for (int i = 0; i <= 255; i++) {
pixels.setPixelColor(0, pixels.Color(255 - i, i, 0)); // Red decreases, Green increases
pixels.show();
delay(10); // Adjust delay for smoothness
}
// Transition from Green to Blue
for (int i = 0; i <= 255; i++) {
pixels.setPixelColor(0, pixels.Color(0, 255 - i, i)); // Green decreases, Blue increases
pixels.show();
delay(10); // Adjust delay for smoothness
}
// Transition from Blue to Red
for (int i = 0; i <= 255; i++) {
pixels.setPixelColor(0, pixels.Color(i, 0, 255 - i)); // Blue decreases, Red increases
pixels.show();
delay(10); // Adjust delay for smoothness
}
}
Adjust delay for smoothness : Ajustez le délai pour plus de fluidité