summaryrefslogtreecommitdiff
path: root/gpslogger
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2013-08-18 12:47:59 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2013-08-18 12:47:59 +0800
commit7d26dc0589f19815522d02b4a86a99a919272d92 (patch)
tree68e9a76fc24107055a619567de7b465dfe303846 /gpslogger
parent009c807f12a59a028baced7a9ce9c761e8694ffb (diff)
download2021-arduino-obd-7d26dc0589f19815522d02b4a86a99a919272d92.tar.gz
2021-arduino-obd-7d26dc0589f19815522d02b4a86a99a919272d92.tar.bz2
2021-arduino-obd-7d26dc0589f19815522d02b4a86a99a919272d92.zip
update GPS logger
Diffstat (limited to 'gpslogger')
-rw-r--r--gpslogger/MicroLCD.h2
-rw-r--r--gpslogger/gpslogger.cbp1
-rw-r--r--gpslogger/gpslogger.ino23
3 files changed, 20 insertions, 6 deletions
diff --git a/gpslogger/MicroLCD.h b/gpslogger/MicroLCD.h
index 1206414..6b01495 100644
--- a/gpslogger/MicroLCD.h
+++ b/gpslogger/MicroLCD.h
@@ -6,7 +6,7 @@
*************************************************************************/
#if !defined(__AVR_ATmega2560__) && !defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega644P__)
-#define MEMORY_SAVING
+//#define MEMORY_SAVING
#endif
typedef enum {
diff --git a/gpslogger/gpslogger.cbp b/gpslogger/gpslogger.cbp
index f0bf1ef..f721d9d 100644
--- a/gpslogger/gpslogger.cbp
+++ b/gpslogger/gpslogger.cbp
@@ -652,6 +652,7 @@
<Add directory="." />
</Compiler>
<Unit filename="MicroLCD.cpp" />
+ <Unit filename="MicroLCD.h" />
<Unit filename="SSD1306.cpp" />
<Unit filename="datalogger.h" />
<Unit filename="gpslogger.ino">
diff --git a/gpslogger/gpslogger.ino b/gpslogger/gpslogger.ino
index d43e4e7..fbfa08d 100644
--- a/gpslogger/gpslogger.ino
+++ b/gpslogger/gpslogger.ino
@@ -14,7 +14,12 @@
#include "datalogger.h"
#include "images.h"
+#if defined(__AVR_ATmega644P__)
#define DISPLAY_MODES 2
+#else
+#define DISPLAY_MODES 1
+#endif
+
#define USE_MPU6050 0
#define SD_CS_PIN SS
@@ -50,8 +55,6 @@ byte displayMode = 0;
TinyGPS gps;
// SD card
-Sd2Card card;
-SdVolume volume;
File sdfile;
CDataLogger logger;
@@ -147,9 +150,13 @@ void processGPS()
bool CheckSD()
{
+ Sd2Card card;
+ SdVolume volume;
+
lcd.setCursor(0, 0);
lcd.setFont(FONT_SIZE_MEDIUM);
pinMode(SS, OUTPUT);
+
if (card.init(SPI_HALF_SPEED, SD_CS_PIN)) {
const char* type;
char buf[20];
@@ -338,7 +345,7 @@ void setup()
}
} while (sat < 3 && millis() - start < 30000);
- GPSUART.println(PMTK_SET_NMEA_UPDATE_10HZ);
+ //GPSUART.println(PMTK_SET_NMEA_UPDATE_10HZ);
logger.openFile(LOG_TYPE_ROUTE, FLAG_CYCLING | FLAG_GPS | (acc ? FLAG_ACC : 0));
@@ -394,6 +401,7 @@ void displaySpeedDistance()
}
}
+#if DISPLAY_MODES > 1
void displayTimeSpeedDistance()
{
uint32_t elapsed = millis() - start;
@@ -441,6 +449,7 @@ void displayTimeSpeedDistance()
n = distance - n * 1000;
lcd.printInt(n / 100);
}
+#endif
void displayMinorInfo()
{
@@ -473,6 +482,7 @@ void loop()
processACC();
#endif
+#if DISPLAY_MODES > 1
switch (displayMode) {
case 0:
displaySpeedDistance();
@@ -481,8 +491,6 @@ void loop()
displayTimeSpeedDistance();
}
- displayMinorInfo();
-
if (digitalRead(8) == 0) {
delay(50);
if (digitalRead(8) == 0) {
@@ -491,4 +499,9 @@ void loop()
initScreen();
}
}
+#else
+ displaySpeedDistance();
+#endif
+
+ displayMinorInfo();
}