Worky please

This commit is contained in:
Steven Tracey 2024-11-20 14:43:59 -05:00
parent 88681d1471
commit 83a49eadf2

View File

@ -44,6 +44,8 @@ int draw() {
Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE); Paint_NewImage(BlackImage, EPD_2in13_V4_WIDTH, EPD_2in13_V4_HEIGHT, 90, WHITE);
Paint_Clear(WHITE); Paint_Clear(WHITE);
EPD_2in13_V4_Init();
Paint_SelectImage(BlackImage); Paint_SelectImage(BlackImage);
Paint_DrawString(10, 40, "Hello, World!", &Font16, WHITE, BLACK); Paint_DrawString(10, 40, "Hello, World!", &Font16, WHITE, BLACK);
@ -66,7 +68,9 @@ int draw() {
for (int i = getTimeRemainingMS(30); i > 500; i = getTimeRemainingMS(30)) { for (int i = getTimeRemainingMS(30); i > 500; i = getTimeRemainingMS(30)) {
startTime = clock(); startTime = clock();
Debug("Time Left: %dms\n", i); Debug("Time Left: %dms\n", i);
Paint_DrawRectangle(10, 112, (i / (30 * 1000)) * 240, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL); int progWidth = (int)(((double)i / (double)(30 * 1000)) * 240);
Debug("Progress bar width: %d", progWidth);
Paint_DrawRectangle(10, 112, progWidth, 92, BLACK, DOT_PIXEL_1X1, DRAW_FILL_FULL);
EPD_2in13_V4_Display_Partial(BlackImage); EPD_2in13_V4_Display_Partial(BlackImage);
endTime = clock(); endTime = clock();
elapsedTime = (double)(endTime - startTime) / CLOCKS_PER_SEC; elapsedTime = (double)(endTime - startTime) / CLOCKS_PER_SEC;