Stream json into parser. Print city on display.
This commit is contained in:
1 parent
5e6606e6cc
commit
f12c812d73
2 files changed
+90
-48
No files matched your search
+17
-11
@@ -21,6 +21,7 @@ static constexpr UWORD COUNTER_HEIGHT = 24;
|
||||
static constexpr UWORD COUNTER_Y = 20;
|
||||
static UBYTE counterBuffer[(COUNTER_WIDTH / 8) * COUNTER_HEIGHT];
|
||||
static int counter = 0;
|
||||
race_info next_race;
|
||||
|
||||
void wifi_connect() {
|
||||
WiFi.setHostname(DEVICE_HOSTNAME);
|
||||
@@ -89,9 +90,14 @@ void display_loop(void *pvParameters) {
|
||||
lastRefresh = millis();
|
||||
|
||||
counter++;
|
||||
snprintf(counterStr, sizeof(counterStr), "Counter: %d", counter);
|
||||
Serial.print("");
|
||||
Serial.println(counterStr);
|
||||
|
||||
if (next_race.session_key == 0) {
|
||||
snprintf(counterStr, sizeof(counterStr), "Counter: %d", counter);
|
||||
Serial.print("");
|
||||
Serial.println(counterStr);
|
||||
} else {
|
||||
snprintf(counterStr, sizeof(counterStr), "%s", next_race.circuit_short_name);
|
||||
}
|
||||
|
||||
Paint_Clear(WHITE);
|
||||
Paint_DrawString_EN(10, 0, counterStr, &Font16, WHITE, BLACK);
|
||||
@@ -117,7 +123,14 @@ void setup() {
|
||||
|
||||
EPD_4IN2_V2_Init();
|
||||
Serial.println("e-Paper initialization complete; clearing display...");
|
||||
EPD_4IN2_V2_Clear();
|
||||
//EPD_4IN2_V2_Clear();
|
||||
|
||||
Paint_NewImage(displayBuffer, EPD_4IN2_V2_WIDTH, EPD_4IN2_V2_HEIGHT, ROTATE_0, WHITE);
|
||||
Paint_SelectImage(displayBuffer);
|
||||
Paint_Clear(WHITE);
|
||||
Paint_DrawString_EN(10, 0, "F1 Display Booting...", &Font16, WHITE, BLACK);
|
||||
Paint_DrawString_EN(10, COUNTER_Y, "Counter: 0", &Font16, WHITE, BLACK);
|
||||
EPD_4IN2_V2_Display(displayBuffer);
|
||||
|
||||
DEV_Delay_ms(500);
|
||||
|
||||
@@ -125,13 +138,6 @@ void setup() {
|
||||
sync_time();
|
||||
printf("Begin display loop.\n");
|
||||
|
||||
Paint_NewImage(displayBuffer, EPD_4IN2_V2_WIDTH, EPD_4IN2_V2_HEIGHT, ROTATE_0, WHITE);
|
||||
Paint_SelectImage(displayBuffer);
|
||||
Paint_Clear(WHITE);
|
||||
Paint_DrawString_EN(10, 0, "F1 Display Test", &Font16, WHITE, BLACK);
|
||||
Paint_DrawString_EN(10, COUNTER_Y, "Counter: 0", &Font16, WHITE, BLACK);
|
||||
EPD_4IN2_V2_Display(displayBuffer);
|
||||
|
||||
Paint_NewImage(counterBuffer, COUNTER_WIDTH, COUNTER_HEIGHT, ROTATE_0, WHITE);
|
||||
Paint_SelectImage(counterBuffer);
|
||||
|
||||
|
||||
Reference in new issue
Block a user