summaryrefslogtreecommitdiff
path: root/nanologger
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@live.com>2016-07-06 14:57:50 +0800
committerStanley Huang <stanleyhuangyc@live.com>2016-07-06 14:57:50 +0800
commitc5a9fdb80df58015c0705d23e2208cb576affd7c (patch)
tree9bc8b7957dea05f3130da6821e65fed441802892 /nanologger
parent23ea91258a34ab568c5dd2878f2eaa8a0dec6fe7 (diff)
download2021-arduino-obd-c5a9fdb80df58015c0705d23e2208cb576affd7c.tar.gz
2021-arduino-obd-c5a9fdb80df58015c0705d23e2208cb576affd7c.tar.bz2
2021-arduino-obd-c5a9fdb80df58015c0705d23e2208cb576affd7c.zip
Renaming read() to readPID() in OBD library
Diffstat (limited to 'nanologger')
-rw-r--r--nanologger/config.h2
-rw-r--r--nanologger/nanologger.ino34
2 files changed, 5 insertions, 31 deletions
diff --git a/nanologger/config.h b/nanologger/config.h
index f283d1c..6ac97a1 100644
--- a/nanologger/config.h
+++ b/nanologger/config.h
@@ -5,7 +5,7 @@
* Data logging/streaming out
**************************************/
#define ENABLE_DATA_OUT 0
-#define ENABLE_DATA_LOG 1
+#define ENABLE_DATA_LOG 0
#define USE_SOFTSERIAL 0
//this defines the format of log file
#define LOG_FORMAT FORMAT_CSV
diff --git a/nanologger/nanologger.ino b/nanologger/nanologger.ino
index 0a4ef0f..d299e09 100644
--- a/nanologger/nanologger.ino
+++ b/nanologger/nanologger.ino
@@ -7,11 +7,10 @@
#include <Arduino.h>
#include <Wire.h>
-#include <OBD.h>
#include <SPI.h>
#include <SD.h>
-#include <MPU6050.h>
-#include "MicroLCD.h"
+#include <OBD.h>
+#include <MicroLCD.h>
#include "images.h"
#include "config.h"
#if USE_SOFTSERIAL
@@ -38,11 +37,9 @@ static int lastValue = 0;
static byte pidTier1[]= {PID_RPM, PID_SPEED, PID_ENGINE_LOAD, PID_THROTTLE};
static byte pidTier2[] = {PID_INTAKE_MAP, PID_MAF_FLOW, PID_TIMING_ADVANCE};
-static byte pidTier3[] = {PID_COOLANT_TEMP, PID_INTAKE_TEMP, PID_AMBIENT_TEMP, PID_FUEL_LEVEL};
#define TIER_NUM1 sizeof(pidTier1)
#define TIER_NUM2 sizeof(pidTier2)
-#define TIER_NUM3 sizeof(pidTier3)
byte pidValue[TIER_NUM1];
@@ -54,14 +51,6 @@ public:
{
showStates();
-#if USE_MPU6050
- Wire.begin();
- if (MPU6050_init() == 0) {
- state |= STATE_ACC_READY;
- showStates();
- }
-#endif
-
do {
showStates();
} while (!init());
@@ -110,8 +99,6 @@ public:
index = 0;
if (index2 == TIER_NUM2) {
index2 = 0;
- logOBDData(pidTier3[index3]);
- index3 = (index3 + 1) % TIER_NUM3;
} else {
logOBDData(pidTier2[index2++]);
}
@@ -214,24 +201,11 @@ private:
lastPid = 0;
}
}
-#if USE_MPU6050
- void processAccelerometer()
- {
- accel_t_gyro_union data;
- MPU6050_readout(&data);
- dataTime = millis();
- // log x/y/z of accelerometer
- logData(PID_ACC, data.value.x_accel, data.value.y_accel, data.value.z_accel);
- //showGForce(data.value.y_accel);
- // log x/y/z of gyro meter
- logData(PID_GYRO, data.value.x_gyro, data.value.y_gyro, data.value.z_gyro);
- }
-#endif
int logOBDData(byte pid)
{
int value = 0;
// send a query to OBD adapter for specified OBD-II pid
- if (read(pid, value)) {
+ if (readPID(pid, value)) {
dataTime = millis();
// log data to SD card
logData(0x100 | pid, value);
@@ -259,7 +233,7 @@ private:
}
if (init()) {
int value;
- if (read(PID_RPM, value) && value > 0)
+ if (readPID(PID_RPM, value) && value > 0)
break;
}
}