diff --git a/src/ws2812.cpp b/src/ws2812.cpp index bb3b836..c7ad5ac 100644 --- a/src/ws2812.cpp +++ b/src/ws2812.cpp @@ -6,8 +6,15 @@ WS2812::WS2812(uint gpio, PIO pio, uint sm) : m_pio{pio}, m_sm{sm} { switchColor(Color::OFF); } -void WS2812::switchColor(Color color) { - putPixel(static_cast(color)); +void WS2812::switchColor(Color color) { putPixel(static_cast(color)); } + +void WS2812::blinkReady() { + for (int i = 0; i < 2; i++) { + switchColor(Color::WHITE); + sleep_ms(250); + switchColor(Color::OFF); + sleep_ms(250); + } } void WS2812::putPixel(uint32_t pixel_grb) { pio_sm_put_blocking(m_pio, m_sm, pixel_grb << 8u); } \ No newline at end of file diff --git a/src/ws2812.h b/src/ws2812.h index f00844f..f7d4a7e 100644 --- a/src/ws2812.h +++ b/src/ws2812.h @@ -18,6 +18,7 @@ class WS2812 { public: WS2812(uint gpio, PIO pio = pio0, uint sm = 0); void switchColor(Color color); + void blinkReady(); private: void putPixel(uint32_t pixel_rgb);