Fixed coordiante behaviour of the matrix

This commit is contained in:
Matthias Mitscherlich
2023-01-18 10:36:36 +01:00
parent 027dd38eb9
commit 1ae7d6ec5a
4 changed files with 92 additions and 77 deletions
+8 -29
View File
@@ -31,7 +31,7 @@ static rmt_transmit_config_t tx_config;
static rmt_encoder_handle_t led_encoder = NULL;
#define RMT_LED_STRIP_RESOLUTION_HZ 10000000 // 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
#define RMT_LED_STRIP_GPIO_NUM 8
#define RMT_LED_STRIP_GPIO_NUM 0
extern "C" void app_main(void)
{
@@ -137,36 +137,15 @@ extern "C" void app_main(void)
while (true)
{
// struct tm tm;
// time(&currentTime);
// localtime_r(&currentTime, &tm);
//
// LOGGER_INFO("%lld\n\r", currentTime);
// LOGGER_INFO("%02i:%02i:%02i\n\r", tm.tm_hour, tm.tm_min, tm.tm_sec);
//
// vTaskDelay(300);
struct tm tm;
time(&currentTime);
localtime_r(&currentTime, &tm);
LOGGER_INFO("%lld\n\r", currentTime);
LOGGER_INFO("%02i:%02i:%02i\n\r", tm.tm_hour, tm.tm_min, tm.tm_sec);
vTaskDelay(300);
LOGGER_DEBUG("Enable pixel (%i:%i)", row, colum);
LEDMatrix.setPixelValue(row, colum, true);
vTaskDelay(100);
LEDMatrix.setPixelValue(row, colum, false);
if (row<10)
{
row++;
}
else
{
row = 0;
if(colum < 2)
{
colum++;
}
else
{
colum = 0;
}
}
}
}