diff --git a/ledcontroller/app/application.cpp b/ledcontroller/app/application.cpp index 29c676f..086f2d5 100644 --- a/ledcontroller/app/application.cpp +++ b/ledcontroller/app/application.cpp @@ -8,7 +8,7 @@ extern "C" { #include "ws2812_i2s.h" } -#define LEDS_CNT 20 +#define LEDS_CNT 40 enum LEDMode { IDLE, @@ -106,12 +106,20 @@ public: void set(uint8_t x, uint8_t y, uint8_t r, uint8_t g, uint8_t b) { int k; - + // 5x4 + /* if (y % 2 == 1) { k = (y+1)*crateWidth - x - 1; } else { k = y*crateWidth + x; } + */ + + if (x % 2 == 0) { + k = x*5 + y; + } else { + k = (x + 1)*5 - y - 1; + } leds[k].r = r; leds[k].g = g;