Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
M5Stack Atom Matrix LED example (without M5Atom library that causes flicker)
#include <FastLED.h>
const int NUM_LEDS = 25;
const int LED_PIN = 27;
static CRGB leds[NUM_LEDS];
CRGB correct(CRGB c) {
// fix RGB order :(
return CRGB(c.g, c.r, c.b);
}
void initDisplay() {
FastLED.addLeds<WS2812, LED_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(20);
}
void setPixelAndShow(index i, CRGB c) {
leds[i] = correct(c);
FastLED.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment