make ssd driver work

This commit is contained in:
2025-12-14 18:51:52 -06:00
parent a80e918d63
commit 5cde1bdfce
7 changed files with 31 additions and 32 deletions

View File

@@ -15,30 +15,18 @@ DemoTask::DemoTask() {
void DemoTask::run() {
/*
ESP_LOGI(TAG, "Example configured to blink GPIO LED!");
gpio_reset_pin(gpio_onboardLed);
gpio_set_direction(gpio_onboardLed, GPIO_MODE_OUTPUT);
ESP_LOGI(__FILE__, "Demo Task: run()");
while (1) {
ESP_LOGI(TAG, "Turning the LED %s!", ledState == true ? "ON" : "OFF");
gpio_set_level(gpio_onboardLed, ledState);
ledState = !ledState;
vTaskDelay(blinkTime / portTICK_PERIOD_MS);
}
*/
ssd_595_t dev = { gpio_ssd_data, gpio_ssd_clk, gpio_ssd_latch, true };
SsdInterface ssd(&dev, ssdDigits);
ESP_LOGI(__FILE__, "Demo Task");
SsdInterface ssd(gpio_ssd_data, gpio_ssd_clk, gpio_ssd_latch, ssdDigits);
uint32_t delay = 500; // ms
uint8_t byte = 0x00;
uint8_t digit = 0;
while(1) {
ESP_LOGI(__FILE__, "Shifting out byte %02hhx", byte);
ssd.writeRaw(&byte, 1);
byte++;
ssd.writeRaw(&digitMap[digit], 1);
digit++;
if(digit >= 16) digit = 0;
vTaskDelay(delay / portTICK_PERIOD_MS);
}