summaryrefslogtreecommitdiff
path: root/gpslogger/gpslogger.ino
diff options
context:
space:
mode:
authorStanley Huang <stanleyhuangyc@gmail.com>2014-04-25 00:36:07 +0800
committerStanley Huang <stanleyhuangyc@gmail.com>2014-04-25 00:36:07 +0800
commit66c820a5492c83465512a9ded4e5b8aedccb9fbb (patch)
treef8d727635f1cb58d26e855486f442bb88dae2b22 /gpslogger/gpslogger.ino
parent746fe26b538f9dc6fcedaaaee4e0e542d53ffe50 (diff)
download2021-arduino-obd-66c820a5492c83465512a9ded4e5b8aedccb9fbb.tar.gz
2021-arduino-obd-66c820a5492c83465512a9ded4e5b8aedccb9fbb.tar.bz2
2021-arduino-obd-66c820a5492c83465512a9ded4e5b8aedccb9fbb.zip
Update GPS logger
Diffstat (limited to 'gpslogger/gpslogger.ino')
-rw-r--r--gpslogger/gpslogger.ino24
1 files changed, 14 insertions, 10 deletions
diff --git a/gpslogger/gpslogger.ino b/gpslogger/gpslogger.ino
index 8f511a1..4208e2c 100644
--- a/gpslogger/gpslogger.ino
+++ b/gpslogger/gpslogger.ino
@@ -6,11 +6,12 @@
*************************************************************************/
#include <Arduino.h>
-#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <TinyGPS.h>
+#if USE_SOFTSERIAL
#include <SoftwareSerial.h>
+#endif
#include "MultiLCD.h"
#include "config.h"
#include "datalogger.h"
@@ -35,6 +36,7 @@ uint32_t time;
#if USE_MPU6050
+#include <Wire.h>
#include <MPU6050.h>
#endif
@@ -45,7 +47,6 @@ uint32_t time;
#else
#define GPSUART Serial
#endif
-#define GPS_BAUDRATE 38400
#define PMTK_SET_NMEA_UPDATE_10HZ "$PMTK220,100*2F"
@@ -285,7 +286,6 @@ void displayMPU6050()
void setup()
{
- Wire.begin();
lcd.begin();
lcd.setFont(FONT_SIZE_MEDIUM);
@@ -295,19 +295,24 @@ void setup()
CheckSD();
lcd.setCursor(0, 2);
+ int index = logger.openFile();
+ lcd.print("File: ");
+ lcd.println(index);
+
+#if USE_MPU6050
+ Wire.begin();
+ acc = initACC();
+
lcd.print("ACC:");
- lcd.print(acc ? "YES" : "NO");
+ lcd.println(acc ? "YES" : "NO");
+#endif
- lcd.setCursor(0, 4);
+ lcd.setCursor(0, 6);
lcd.print("GPS:");
GPSUART.begin(GPS_BAUDRATE);
logger.initSender();
-#if USE_MPU6050
- acc = initACC();
-#endif
-
byte n = 0xff;
uint32_t tm = 0;
start = millis();
@@ -346,7 +351,6 @@ void setup()
//GPSUART.println(PMTK_SET_NMEA_UPDATE_10HZ);
- logger.openFile(LOG_TYPE_TRIP, FLAG_GPS | (acc ? FLAG_ACC : 0));
initScreen();