diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-08-16 17:36:18 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2013-08-16 17:36:18 +0800 |
commit | af9ef0d13488c6b3772c639cb4b045c651af806c (patch) | |
tree | a33555db29ebade6b8ea26045d3a8b6593a82601 /obdlogger/obdlogger.ino | |
parent | 18e825a8a2ea5424fdf6ff940ed76412ac7dfdad (diff) | |
download | 2021-arduino-obd-af9ef0d13488c6b3772c639cb4b045c651af806c.tar.gz 2021-arduino-obd-af9ef0d13488c6b3772c639cb4b045c651af806c.tar.bz2 2021-arduino-obd-af9ef0d13488c6b3772c639cb4b045c651af806c.zip |
optimize for 32KB program space
Diffstat (limited to 'obdlogger/obdlogger.ino')
-rw-r--r-- | obdlogger/obdlogger.ino | 19 |
1 files changed, 13 insertions, 6 deletions
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); |