summaryrefslogtreecommitdiff
path: root/samples/dashboard_4884/dashboard_4884.ino
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2014-01-08 19:53:17 +1100
committerStanley Huang <stanleyhuangyc@gmail.com>2014-01-08 19:53:17 +1100
commit876105a52a99b342f31a9319b9da7e7b3f123560 (patch)
tree98593580c8cf6e3c867f398daa451704de20a893 /samples/dashboard_4884/dashboard_4884.ino
parent9f525a76fa72de7078868cd4b818cdd83043a3ec (diff)
download2021-arduino-obd-876105a52a99b342f31a9319b9da7e7b3f123560.tar.gz
2021-arduino-obd-876105a52a99b342f31a9319b9da7e7b3f123560.tar.bz2
2021-arduino-obd-876105a52a99b342f31a9319b9da7e7b3f123560.zip
Update samples
Diffstat (limited to 'samples/dashboard_4884/dashboard_4884.ino')
-rw-r--r--samples/dashboard_4884/dashboard_4884.ino27
1 files changed, 14 insertions, 13 deletions
diff --git a/samples/dashboard_4884/dashboard_4884.ino b/samples/dashboard_4884/dashboard_4884.ino
index 044ef67..ba3aeef 100644
--- a/samples/dashboard_4884/dashboard_4884.ino
+++ b/samples/dashboard_4884/dashboard_4884.ino
@@ -7,7 +7,8 @@
*************************************************************************/
#include <Arduino.h>
-#include "OBD.h"
+#include <Wire.h>
+#include <OBD.h>
#include "LCD4884.h"
//keypad debounce parameter
@@ -179,7 +180,7 @@ public:
lcd.LCD_write_string(0, 3, "Wait ignition ", MENU_NORMAL);
do {
delay(100);
- } while (!readSensor(PID_RPM, value) || value == 0);
+ } while (!read(PID_RPM, value) || value == 0);
lcd.LCD_write_string(0, 4, "Engine started", MENU_NORMAL);
delay(1000);
}
@@ -263,49 +264,49 @@ public:
private:
void DisplayData1()
{
- if (readSensor(PID_RPM, value)) {
+ if (read(PID_RPM, value)) {
ShowRPM(value);
}
- if (readSensor(PID_SPEED, value)) {
+ if (read(PID_SPEED, value)) {
ShowSpeed(value);
}
- if (readSensor(PID_ENGINE_LOAD, value)) {
+ if (read(PID_ENGINE_LOAD, value)) {
ShowEngineLoad(value);
}
}
void DisplayData2()
{
- if (readSensor(PID_RPM, value)) {
+ if (read(PID_RPM, value)) {
ShowRPM(value);
}
- if (readSensor(PID_SPEED, value)) {
+ if (read(PID_SPEED, value)) {
ShowSpeed2(value);
}
}
void DisplayData21()
{
- if (readSensor(PID_COOLANT_TEMP, value)) {
+ if (read(PID_COOLANT_TEMP, value)) {
ShowTemperature(value, 42, 3);
}
}
void DisplayData22()
{
- if (readSensor(PID_INTAKE_TEMP, value)) {
+ if (read(PID_INTAKE_TEMP, value)) {
ShowTemperature(value, 42, 4);
}
}
void DisplayData23()
{
- if (readSensor(PID_AMBIENT_TEMP, value)) {
+ if (read(PID_AMBIENT_TEMP, value)) {
ShowTemperature(value, 42, 5);
}
}
void DisplayData3()
{
- if (readSensor(PID_SPEED, value)) {
+ if (read(PID_SPEED, value)) {
ShowSpeed2(value);
}
- if (readSensor(PID_INTAKE_MAP, value)) {
+ if (read(PID_INTAKE_MAP, value)) {
char buf[8];
sprintf(buf, "%3u", value);
lcd.LCD_write_string(24, 4, buf, MENU_NORMAL);
@@ -314,7 +315,7 @@ private:
sprintf(buf, "%d.%02d", boost / 100, boost % 100);
lcd.LCD_write_string_big(0, 0, buf, MENU_NORMAL);
}
- if (readSensor(PID_FUEL_PRESSURE, value)) {
+ if (read(PID_FUEL_PRESSURE, value)) {
char buf[8];
sprintf(buf, "%3u", value);
lcd.LCD_write_string(24, 5, buf, MENU_NORMAL);