Difference between revisions of "XIAO-RA4M1"
(→code) |
(→Play with RGB LEDs) |
||
| Line 37: | Line 37: | ||
[[File:OLED Display 96x96 recto.jpg|150px]] | [[File:OLED Display 96x96 recto.jpg|150px]] | ||
| − | === Play with RGB LEDs === | + | === Play with RGB LEDs Code === |
| − | |||
LED user allumé<br> | LED user allumé<br> | ||
Revision as of 19:49, 27 May 2025
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 Code
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é
code
https://wiki.myows.top/index.php?title=OLED_Display_1.12#Code_Hello_World.21_.28u8g2.29