summaryrefslogtreecommitdiff
path: root/libraries/OBD/examples/obd_uart_test
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2015-12-05 15:49:28 +1100
committerStanley Huang <stanleyhuangyc@gmail.com>2015-12-05 15:49:28 +1100
commit7aff146ad7b3bdd70901f77b0aadfc32dbdd56f5 (patch)
tree37081c92317b576744dc186d6f9cf788c879d8c1 /libraries/OBD/examples/obd_uart_test
parentc25dc8142813ad90438a42f1c5e5dd8d538ff428 (diff)
download2021-arduino-obd-7aff146ad7b3bdd70901f77b0aadfc32dbdd56f5.tar.gz
2021-arduino-obd-7aff146ad7b3bdd70901f77b0aadfc32dbdd56f5.tar.bz2
2021-arduino-obd-7aff146ad7b3bdd70901f77b0aadfc32dbdd56f5.zip
Update example sketches for OBD library
Diffstat (limited to 'libraries/OBD/examples/obd_uart_test')
-rw-r--r--libraries/OBD/examples/obd_uart_test/obd_uart_test.ino7
1 files changed, 5 insertions, 2 deletions
diff --git a/libraries/OBD/examples/obd_uart_test/obd_uart_test.ino b/libraries/OBD/examples/obd_uart_test/obd_uart_test.ino
index 944d6f2..adb68b0 100644
--- a/libraries/OBD/examples/obd_uart_test/obd_uart_test.ino
+++ b/libraries/OBD/examples/obd_uart_test/obd_uart_test.ino
@@ -13,8 +13,8 @@
// On Arduino Leonardo, Micro, MEGA or DUE, hardware serial can be used for output
// as OBD-II adapter should connect to Serial1, otherwise we use software serial
-SoftwareSerial mySerial(A2, A3);
-//#define mySerial Serial
+//SoftwareSerial mySerial(A2, A3);
+#define mySerial Serial
COBD obd;
@@ -51,6 +51,9 @@ void testOut()
void readPID()
{
static const byte pidlist[] = {PID_ENGINE_LOAD, PID_COOLANT_TEMP, PID_RPM, PID_SPEED, PID_TIMING_ADVANCE, PID_INTAKE_TEMP, PID_THROTTLE, PID_FUEL_LEVEL};
+ mySerial.print('[');
+ mySerial.print(millis());
+ mySerial.print(']');
for (byte i = 0; i < sizeof(pidlist) / sizeof(pidlist[0]); i++) {
byte pid = pidlist[i];
bool valid = obd.isValidPID(pid);