summaryrefslogtreecommitdiff
path: root/obdlogger
diff options
context:
space:
mode:
Diffstat (limited to 'obdlogger')
-rw-r--r--obdlogger/obdlogger.cbp6
-rw-r--r--obdlogger/obdlogger.ino19
2 files changed, 14 insertions, 11 deletions
diff --git a/obdlogger/obdlogger.cbp b/obdlogger/obdlogger.cbp
index b2ca76b..b1767af 100644
--- a/obdlogger/obdlogger.cbp
+++ b/obdlogger/obdlogger.cbp
@@ -38,7 +38,6 @@
<Add option="-mmcu=$(MCU)" />
<Add option="-DF_CPU=16000000L" />
<Add option="-D__AVR_ATmega328P__" />
- <Add option="-DMEMORY_SAVING" />
<Add directory="$(ARDUINO_DIR)/hardware/arduino/cores/arduino" />
<Add directory="$(ARDUINO_DIR)/libraries" />
<Add directory="$(ARDUINO_DIR)/hardware/arduino/variants/standard" />
@@ -583,12 +582,9 @@
<Compiler>
<Add directory="." />
</Compiler>
- <Unit filename="MultiLCD.cpp" />
- <Unit filename="MultiLCD.h" />
+ <Unit filename="MicroLCD.cpp" />
<Unit filename="SSD1306.cpp" />
- <Unit filename="SSD1306.h" />
<Unit filename="datalogger.h" />
- <Unit filename="fonts.cpp" />
<Unit filename="images.h" />
<Unit filename="obdlogger.ino">
<Option compile="1" />
diff --git a/obdlogger/obdlogger.ino b/obdlogger/obdlogger.ino
index ac16184..7ed73cf 100644
--- a/obdlogger/obdlogger.ino
+++ b/obdlogger/obdlogger.ino
@@ -9,7 +9,6 @@
#include <Wire.h>
#include <OBD.h>
#include <SD.h>
-#include <TinyGPS.h>
#include <MPU6050.h>
#include <SoftwareSerial.h>
#include "MicroLCD.h"
@@ -70,6 +69,8 @@ LCD_SSD1306 lcd;
#ifdef GPSUART
+#include <TinyGPS.h>
+
#define PMTK_SET_NMEA_UPDATE_1HZ "$PMTK220,1000*1F"
#define PMTK_SET_NMEA_UPDATE_5HZ "$PMTK220,200*2C"
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"
@@ -131,16 +132,22 @@ public:
if (state & STATE_ACC_READY) flags |= FLAG_ACC;
uint16_t index = openFile(LOG_TYPE_DEFAULT, flags);
lcd.setFont(FONT_SIZE_SMALL);
- lcd.setFlags(FLAG_PAD_ZERO);
lcd.setCursor(86, 0);
- lcd.write('[');
- lcd.printInt(index, 5);
- lcd.write(']');
- lcd.setFlags(0);
+ if (index) {
+ lcd.write('[');
+ lcd.setFlags(FLAG_PAD_ZERO);
+ lcd.printInt(index, 5);
+ lcd.setFlags(0);
+ lcd.write(']');
+ } else {
+ lcd.print("NO LOG");
+ }
delay(1000);
+#ifndef MEMORY_SAVING
showECUCap();
delay(3000);
+#endif
readSensor(PID_DISTANCE, startDistance);