/*
___ WEMO_STM32_RGB_BLINK___
In this lesson, we are going to blink an RGB LED using the arduino framework.
The Red,blue,and green blinks every 250ms using the digitalWrite function
Remember to choose the typeof RGB led becausethey are twotypeRGB Leds. The common cathode and Anode RGB
___ WEMO_STM32_RGB_BLINK___
*/
#define GREEN D0
#define BLUE D1
#define RED D2
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, STM32!");
pinMode(RED, OUTPUT); // Setthe RED LED as an output
pinMode(BLUE, OUTPUT);
pinMode(GREEN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(RED, HIGH); // Turn ON the Red LED
delay(250); // Keep the Red led ON for 250mS
digitalWrite(RED, LOW); // Turn OFF the Red LED
delay(250); // Keep the Red led OFF for 250mS
digitalWrite(BLUE, HIGH); // Turn ON BLUE LED
delay(250); // Keep the BLUE led ON for 250mS
digitalWrite(BLUE, LOW); // Turn OFF BLUE LED
delay(250); // Keep the BLUE led OFF for 250mS
digitalWrite(GREEN, HIGH); // Turn ON the GREEN LED
delay(250); // Keep the GREEN led ON for 250mS
digitalWrite(GREEN, LOW); // Turn OFF the GREEN LED
delay(250); // Keep the Red GREEN OFF for 250mS
}
Loading
st-nucleo-l031k6
st-nucleo-l031k6