mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-15 04:01:04 +00:00
change test file to include more measurements
This commit is contained in:
@@ -33,7 +33,7 @@ void setup()
|
|||||||
|
|
||||||
Serial.println("Attempting to connect to ELM327...");
|
Serial.println("Attempting to connect to ELM327...");
|
||||||
|
|
||||||
if (!myELM327.begin(ELM_PORT, true, 20000))
|
if (!myELM327.begin(ELM_PORT, false, 2000))
|
||||||
{
|
{
|
||||||
Serial.println("Couldn't connect to OBD scanner");
|
Serial.println("Couldn't connect to OBD scanner");
|
||||||
while (1);
|
while (1);
|
||||||
@@ -47,11 +47,35 @@ void loop()
|
|||||||
{
|
{
|
||||||
float tempRPM = myELM327.rpm();
|
float tempRPM = myELM327.rpm();
|
||||||
|
|
||||||
|
// float tempval3 = myELM327.fuelInjectTiming();
|
||||||
|
|
||||||
if (myELM327.nb_rx_state == ELM_SUCCESS)
|
if (myELM327.nb_rx_state == ELM_SUCCESS)
|
||||||
{
|
{
|
||||||
rpm = (uint32_t)tempRPM;
|
rpm = (uint32_t)tempRPM;
|
||||||
Serial.print("RPM: "); Serial.println(rpm);
|
Serial.print("RPM: "); Serial.println(rpm);
|
||||||
|
// Serial.print("feul t: "); Serial.println(tempval3);
|
||||||
}
|
}
|
||||||
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
|
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
|
||||||
myELM327.printError();
|
myELM327.printError();
|
||||||
|
|
||||||
|
float tempval1 = myELM327.engineCoolantTemp();
|
||||||
|
if (myELM327.nb_rx_state == ELM_SUCCESS)
|
||||||
|
{
|
||||||
|
Serial.print("coolant: "); Serial.println(tempval1);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
|
||||||
|
myELM327.printError();
|
||||||
|
|
||||||
|
float tempval2 = myELM327.oilTemp();
|
||||||
|
|
||||||
|
if (myELM327.nb_rx_state == ELM_SUCCESS)
|
||||||
|
{
|
||||||
|
Serial.print("oil: "); Serial.println(tempval2);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
|
||||||
|
myELM327.printError();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user