mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-16 04:31:04 +00:00
tested ELM327 connection and refactored bt driver to include elm327
This commit is contained in:
@@ -14,7 +14,7 @@ Program to create a car monitor display using:
|
||||
#include "obd2_display.h"
|
||||
#include "statemachine.h"
|
||||
#include "obd2_util.h"
|
||||
#include "obd2_bt.h"
|
||||
#include "obd2_elm327.h"
|
||||
|
||||
#define DEBUG 1
|
||||
// #define RTT_MR 0x400E1A30U
|
||||
@@ -86,7 +86,7 @@ char device_label_i = -1; /* counter in the current device label */
|
||||
|
||||
char bt_state = BT_INITIALISING;
|
||||
|
||||
obd2_bt_t bt;
|
||||
obd2_elm327_t elm327;
|
||||
|
||||
void on_init_enter();
|
||||
void on_init_run();
|
||||
@@ -191,7 +191,7 @@ void on_init_run()
|
||||
display.print("Bluetooth ", (display.getDisplayXSize() / 2) - (11 * display.getFontXsize()), initialization_y + 50);
|
||||
|
||||
char current_bt_state[BT_STATE_LENGTH];
|
||||
obd2_bt_get_state(&bt, (char *)current_bt_state);
|
||||
obd2_elm327_get_state(&elm327, (char *)current_bt_state);
|
||||
display.print(current_bt_state, (display.getDisplayXSize() / 2) + display.getFontXsize(), initialization_y + 50);
|
||||
display.setBackColor(VGA_BLACK);
|
||||
|
||||
@@ -437,7 +437,7 @@ void setup()
|
||||
|
||||
/* Serial1 is bluetooth module, pin 18 and 19. */
|
||||
Serial1.begin(BT_BAUD);
|
||||
obd2_bt_init(&bt);
|
||||
obd2_elm327_init(&elm327);
|
||||
}
|
||||
|
||||
void loop()
|
||||
|
||||
Reference in New Issue
Block a user