test displaying values in main state

This commit is contained in:
Sem van der Hoeven
2024-01-22 23:52:17 +01:00
parent 0da353338e
commit 50fd4c813d
4 changed files with 202 additions and 63 deletions

View File

@@ -55,6 +55,18 @@ Be sure to disconnect the TX and RX pins from the BT module when programming the
#define ELM327_SERIAL Serial2
#define UPDATE_RPM_POS 0x00
#define UPDATE_THROTTLE_POS 0x01
#define UPDATE_COOLANT_TEMP_POS 0x02
#define UPDATE_INTAKE_AIR_TEMP_POS 0x03
#define UPDATE_AMBIENT_AIR_TEMP_POS 0x04
#define UPDATE_OIL_TEMP_POS 0x05
#define UPDATE_ENGINE_LOAD_POS 0x06
#define UPDATE_BATTERY_VOLTAGE_POS 0x07
#define UPDATE_FUEL_PRESSURE_POS 0x08
#define UPDATE_SPEED_POS 0x09
#define UPDATE_MANIFOLD_PRESSURE_POS 0x0A
enum BluetoothState
{
BT_INITIALISING = 0,
@@ -72,6 +84,7 @@ typedef struct obt2_elm327_tag
ELM327 *elm327;
enum BluetoothState bt_state;
void (*on_state_change)();
uint16_t value_updates;
uint16_t rpm;
uint8_t throttle_percent;
uint8_t engine_coolant_temp;
@@ -100,6 +113,8 @@ char obd2_elm327_init(obd2_elm327_t *elm327);
*/
void obd2_elm327_process(obd2_elm327_t *elm327);
void obd2_elm327_check_connection(obd2_elm327_t *elm327);
/**
* @brief copies the current state of the bluetooth module to the state string
*