Created
July 10, 2020 09:52
-
-
Save tomoto/1c846bcedc1393f92f29ebf66de70af6 to your computer and use it in GitHub Desktop.
M5Stack Atom Matrix LED example (without M5Atom library that causes flicker)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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