diff options
| -rw-r--r-- | main/main.cpp | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/main/main.cpp b/main/main.cpp index f623e39..1d64d95 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -57,41 +57,36 @@ extern "C" void app_main(void) InovaLedDisplay display = InovaLedDisplay(PIN_NUM_MISO, PIN_NUM_MOSI, PIN_NUM_CLK, PIN_NUM_CS, PIN_NUM_R_LATCH, PIN_NUM_R_CLK, PIN_NUM_R_ADDR_0, PIN_NUM_R_ADDR_1, PIN_NUM_R_ADDR_2); display.fillScreen(0); - display.drawPixel(80, 4, 3); display.setCursor(0, 0); - String some_string = "meow"; - display.print(some_string); + display.setTextColor(2); + display.setTextWrap(false); + display.print("Adafruit GFX 0123456789"); - //display.drawChar(0, 0, 'M', 3, 0, 1); - //display.drawChar(6, 0, 'e', 3, 0, 1); - //display.drawChar(12, 0, 'o', 3, 0, 1); - //display.drawChar(18, 0, 'w', 3, 0, 1); + TaskHandle_t taskHandle; + xTaskCreate(runDisplayTask, "updateDisplay", STACK_SIZE, &display, tskIDLE_PRIORITY, &taskHandle); - //TaskHandle_t taskHandle; - //xTaskCreate(runDisplayTask, "updateDisplay", STACK_SIZE, &display, tskIDLE_PRIORITY, &taskHandle); - - runDisplayTask(&display); + //runDisplayTask(&display); + //while(true) { + // vTaskDelay(100 / portTICK_PERIOD_MS); + //} + int j = display.width(); + int color = 1; + String hello = "Hello World!! 0123456789"; + int hello_length = hello.length(); + int min_x = hello_length * -6; while(true) { - vTaskDelay(100 / portTICK_PERIOD_MS); - } - /* int j = NUM_COL; */ - /* int color = 1; */ - /* char* hello = "Hello World!! 0123456789"; */ - /* int hello_length = strlen(hello); */ - /* int min_x = hello_length * -CHAR_WIDTH; */ - /* while(true) { */ - /* for(int i = 0; i < strlen(hello); i++) { */ - /* drawCharAtPosition(hello[i], j + (i * CHAR_WIDTH), 0, color); */ - /* } */ + display.fillScreen(0); + display.setCursor(j, 0); + display.print(hello); - /* if(--j == min_x) { */ - /* j = NUM_COL; */ - /* if(++color > 3) { */ - /* color = 1; */ - /* } */ - /* } */ - /* vTaskDelay(50 / portTICK_PERIOD_MS); */ - /* } */ + if(--j == min_x) { + j = display.width(); + if(++color > 3) { + color = 1; + } + } + vTaskDelay(50 / portTICK_PERIOD_MS); + } } |
