ledcontroller: wide flaschentaschen input

master
informatic 2019-04-16 16:12:11 +02:00
parent f19441985e
commit 1a0de982d3
1 changed files with 10 additions and 2 deletions

View File

@ -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;