mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-15 20:21:03 +00:00
fix displaying bluetooth state and add waiting for elm327 connection
This commit is contained in:
@@ -190,8 +190,8 @@ void on_init_run()
|
||||
display.setColor(VGA_BLACK);
|
||||
display.print("Bluetooth ", (display.getDisplayXSize() / 2) - (11 * display.getFontXsize()), initialization_y + 50);
|
||||
|
||||
char current_bt_state[BT_STATE_LENGTH];
|
||||
obd2_elm327_get_state(&elm327, (char *)current_bt_state);
|
||||
char current_bt_state[BT_STATE_LENGTH] = "poep";
|
||||
obd2_elm327_get_state(&elm327, current_bt_state);
|
||||
display.print(current_bt_state, (display.getDisplayXSize() / 2) + display.getFontXsize(), initialization_y + 50);
|
||||
display.setBackColor(VGA_BLACK);
|
||||
|
||||
@@ -423,7 +423,7 @@ void setup()
|
||||
|
||||
/* Init display */
|
||||
display.InitLCD();
|
||||
display.setFont(OCR_A_Extended_M);
|
||||
// display.setFont(OCR_A_Extended_M);
|
||||
|
||||
#if (DEBUG == 1)
|
||||
Serial.println("Starting");
|
||||
@@ -435,9 +435,17 @@ void setup()
|
||||
statemachine_register_state(&main_state, STATE_CAR_INFO);
|
||||
statemachine_init();
|
||||
|
||||
/* Serial1 is bluetooth module, pin 18 and 19. */
|
||||
Serial1.begin(BT_BAUD);
|
||||
display.setFont(BigFont);
|
||||
display.setColor(VGA_AQUA);
|
||||
display.print("Welcome Sem",(display.getDisplayXSize()/2) - ((11 * display.getFontXsize())/2),120);
|
||||
display.setColor(VGA_FUCHSIA);
|
||||
display.print("Just a moment...",(display.getDisplayXSize()/2) - ((16 * display.getFontXsize())/2),140);
|
||||
|
||||
obd2_elm327_init(&elm327);
|
||||
|
||||
display.clrScr();
|
||||
|
||||
display.setFont(OCR_A_Extended_M);
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
Reference in New Issue
Block a user