led_matrix/main/led_matrix_main.c

38 lines
755 B
C
Raw Normal View History

2024-01-31 13:05:20 +08:00
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_check.h"
#include "led_matrix.h"
2024-01-31 17:52:23 +08:00
int line = 16;
static const char *TAG = "main";
2024-01-31 13:05:20 +08:00
void app_main(void)
{
led_matrix_init();
2024-01-31 13:05:20 +08:00
uint8_t color[line][64];
int i, j, k = 0;
for (i = 0; i < line; i++)
for (j = 0; j < 64; j++)
{
color[i][j] = k++;
k = k % 256;
}
led_matrix_fill_rectangle(0, 0, line, 64, color);
led_matrix_set_brightness(0);
int brightness = 0;
2024-01-31 13:05:20 +08:00
while (1) {
// led_matrix_set_brightness(brightness);
// brightness = (brightness + 100) % 1900;
vTaskDelay(pdMS_TO_TICKS(100));
2024-01-31 13:05:20 +08:00
}
}