diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2015-03-23 17:10:40 +1100 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2015-03-23 17:10:40 +1100 |
commit | b77a6bada4262ea9fcc211b9ae8f5a3c767cb7bd (patch) | |
tree | 8c537ba6709f03185bb764f2b40ae780f7f41faf /megalogger/megalogger.ino | |
parent | 6e30c747d4a63ba4dabaf6de9ef4321db2ac346f (diff) | |
download | 2021-arduino-obd-b77a6bada4262ea9fcc211b9ae8f5a3c767cb7bd.tar.gz 2021-arduino-obd-b77a6bada4262ea9fcc211b9ae8f5a3c767cb7bd.tar.bz2 2021-arduino-obd-b77a6bada4262ea9fcc211b9ae8f5a3c767cb7bd.zip |
Add support for MPU-9150
Diffstat (limited to 'megalogger/megalogger.ino')
-rw-r--r-- | megalogger/megalogger.ino | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino index 65fad3c..22ba948 100644 --- a/megalogger/megalogger.ino +++ b/megalogger/megalogger.ino @@ -178,7 +178,7 @@ void showPIDData(byte pid, int value) lcd.printInt(value, 2); } break; - case PID_VOLTAGE: + case PID_BATTERY_VOLTAGE: lcd.setFontSize(FONT_SIZE_LARGE); lcd.setCursor(80, 18); lcd.printInt(value / 10, 2); @@ -453,6 +453,7 @@ void processAccelerometer() #if USE_MPU9150 int16_t mx, my, mz; #endif + int temp; if (logger.dataTime - lastMemsDataTime < ACC_DATA_INTERVAL) { return; @@ -466,7 +467,7 @@ void processAccelerometer() logger.dataTime = millis(); - lcd.setFontSize(FONT_SIZE_SMALL); + temp = accelgyro.getTemperature(); ax /= ACC_DATA_RATIO; ay /= ACC_DATA_RATIO; @@ -475,7 +476,8 @@ void processAccelerometer() gy /= GYRO_DATA_RATIO; gz /= GYRO_DATA_RATIO; - // display acc data + // display MEMS data + lcd.setFontSize(FONT_SIZE_SMALL); lcd.setCursor(214, 22); setColorByValue(ax, 50, 100, 200); lcd.print(ax); @@ -517,6 +519,7 @@ void processAccelerometer() // log x/y/z of compass logger.logData(PID_COMPASS, mx, my, mz); #endif + logger.logData(PID_MEMS_TEMP, temp); lastMemsDataTime = logger.dataTime; #endif @@ -791,8 +794,8 @@ void loop() index3 = (index3 + 1) % TIER_NUM3; if (index3 == 0) { int v = obd.getVoltage(); - showPIDData(PID_VOLTAGE, v); - logger.logData(PID_VOLTAGE, v); + showPIDData(PID_BATTERY_VOLTAGE, v); + logger.logData(PID_BATTERY_VOLTAGE, v); } } else { if (obd.isValidPID(pidTier2[index2])) { |