#include <FastLED.h>
// Define the number of LEDs and the pin
#define NUM_LEDS 16
#define DATA_PIN PB6
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(50);
}
void loop() {
// A simple example to light up the LEDs in red, green, and blue
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Red;
FastLED.show();
delay(50);
}
delay(500);
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Green;
FastLED.show();
delay(50);
}
delay(500);
for(int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Blue;
FastLED.show();
delay(50);
}
delay(500);
}
Loading
stm32-bluepill
stm32-bluepill