summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--megalogger/config.h3
-rw-r--r--megalogger/megalogger.cbp8
-rw-r--r--megalogger/megalogger.depend74
-rw-r--r--megalogger/megalogger.ino20
4 files changed, 18 insertions, 87 deletions
diff --git a/megalogger/config.h b/megalogger/config.h
index 7b4c1f7..151165a 100644
--- a/megalogger/config.h
+++ b/megalogger/config.h
@@ -9,7 +9,7 @@
/**************************************
* Choose model of OBD-II Adapter
**************************************/
-#define OBD_MODEL OBD_MODEL_UART
+#define OBD_MODEL OBD_MODEL_I2C
#define OBD_PROTOCOL 0 /* 0 for auto */
/**************************************
@@ -45,7 +45,6 @@
**************************************/
#define ENABLE_DATA_OUT 0
#define ENABLE_DATA_LOG 1
-#define USE_OBD_BT 0
#define LOG_FORMAT FORMAT_CSV /* options: FORMAT_CSV, FORMAT_BIN */
/**************************************
diff --git a/megalogger/megalogger.cbp b/megalogger/megalogger.cbp
index 3120a28..eec8b7d 100644
--- a/megalogger/megalogger.cbp
+++ b/megalogger/megalogger.cbp
@@ -2,7 +2,7 @@
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
- <Option title="megalogger" />
+ <Option title="MegaLogger" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
@@ -25,7 +25,7 @@
<Add option="-lardusim" />
</Linker>
<Environment>
- <Variable name="ARDUINO_DIR" value="$(APP_PATH)/ardusim" />
+ <Variable name="ARDUINO_DIR" value="$(APP_PATH)\ardusim" />
</Environment>
</Target>
<Target title="Simulator - Release">
@@ -48,7 +48,7 @@
<Add option="-lardusim" />
</Linker>
<Environment>
- <Variable name="ARDUINO_DIR" value="$(APP_PATH)/ardusim" />
+ <Variable name="ARDUINO_DIR" value="$(APP_PATH)\ardusim" />
</Environment>
</Target>
<Target title="Arduino Uno">
@@ -528,7 +528,7 @@
<Add after='avr-size --mcu=$(MCU) --format=avr &quot;$(TARGET_OUTPUT_FILE)&quot;' />
</ExtraCommands>
<Environment>
- <Variable name="BOARD" value="Arduino Mega 2560/ADK" />
+ <Variable name="BOARD" value="Arduino Mega 2560\ADK" />
<Variable name="BOARD_ID" value="mega2560" />
<Variable name="MCU" value="atmega2560" />
<Variable name="MCU_CLOCK" value="16" />
diff --git a/megalogger/megalogger.depend b/megalogger/megalogger.depend
deleted file mode 100644
index 78bb893..0000000
--- a/megalogger/megalogger.depend
+++ /dev/null
@@ -1,74 +0,0 @@
-# depslib dependency file v1.0
-1393867477 source:e:\arduino\arduinoobd\megalogger\megalogger.ino
- <Arduino.h>
- <Wire.h>
- <OBD.h>
- <SD.h>
- <MultiLCD.h>
- <TinyGPS.h>
- <MPU6050.h>
- <SPI.h>
- "config.h"
- "images.h"
- <SoftwareSerial.h>
- "datalogger.h"
-
-1371033101 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\arduino.h
- <stdlib.h>
- <string.h>
- <math.h>
- <avr/pgmspace.h>
- <avr/io.h>
- <avr/interrupt.h>
- "binary.h"
- "WCharacter.h"
- "WString.h"
- "HardwareSerial.h"
- "pins_arduino.h"
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\binary.h
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\wcharacter.h
- <ctype.h>
-
-1371033133 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\wstring.h
- <stdlib.h>
- <string.h>
- <ctype.h>
- <avr/pgmspace.h>
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\hardwareserial.h
- <inttypes.h>
- "Stream.h"
- "USBAPI.h"
-
-1371032829 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\stream.h
- <inttypes.h>
- "Print.h"
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\print.h
- <inttypes.h>
- <stdio.h>
- "WString.h"
- "Printable.h"
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\printable.h
- <new.h>
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\new.h
- <stdlib.h>
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\cores\arduino\usbapi.h
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\variants\standard\pins_arduino.h
- <avr/pgmspace.h>
-
-1393927071 e:\arduino\arduinoobd\megalogger\config.h
-
-1391012219 e:\arduino\arduinoobd\megalogger\images.h
-
-1391012219 e:\arduino\arduinoobd\megalogger\datalogger.h
-
-1362986950 d:\apps\codeblocks\arduino\hardware\arduino\variants\mega\pins_arduino.h
- <avr/pgmspace.h>
-
diff --git a/megalogger/megalogger.ino b/megalogger/megalogger.ino
index da65d6d..d65eec1 100644
--- a/megalogger/megalogger.ino
+++ b/megalogger/megalogger.ino
@@ -132,7 +132,7 @@ public:
lcd.printInt(index);
#endif
-#ifndef MEMORY_SAVING
+#if 0
showECUCap();
delay(1000);
#endif
@@ -448,14 +448,12 @@ private:
for (byte i = 0; i < sizeof(pidlist) / sizeof(pidlist[0]); i++) {
lcd.setCursor(160, i * 2 + 4);
lcd.print(namelist[i]);
- }
- for (byte i = 0; i < sizeof(pidlist) / sizeof(pidlist[0]); i++) {
+ lcd.write(' ');
bool valid = isValidPID(pidlist[i]);
lcd.setTextColor(valid ? RGB16_GREEN : RGB16_RED);
- lcd.setCursor(304, i * 2 + 4);
lcd.draw(valid ? tick : cross, 16, 16);
+ lcd.setTextColor(RGB16_WHITE);
}
- lcd.setTextColor(RGB16_WHITE);
}
void reconnect()
{
@@ -467,8 +465,16 @@ private:
lcd.print("Reconnecting...");
state &= ~(STATE_OBD_READY | STATE_ACC_READY | STATE_DATE_SAVED);
//digitalWrite(SD_CS_PIN, LOW);
- for (int i = 0; !init(); i++) {
- if (i == 10) lcd.clear();
+ for (uint16_t i = 0; ; i++) {
+ if (i == 5) {
+ lcd.backlight(false);
+ lcd.clear();
+ }
+ if (init()) {
+ int value;
+ if (read(PID_RPM, value) && value > 0)
+ break;
+ }
}
fileIndex++;
setup();