make ssd driver work
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user