/* Arduino Projects for Dummies * by Brock Craft * * Chapter 13: Building a GPS Data Logger * Uses Adafruit Industries Ultimate logger shield * to capture GPS data and record it to an SD card * * Requires: * Adafruit_GPS library * SD library * This code is from http://www.adafruit.com and is slightly modified to * run on an Arduino Uno by default. * Ladyada's logger modified by Bill Greiman to use the SdFat library * * v0.1 30.04.2013 */ #include #include #include #include #include "GPSconfig.h" SoftwareSerial mySerial(8, 7); Adafruit_GPS GPS(&mySerial); // Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console // Set to 'true' if you want to debug and listen to the raw GPS sentences #define GPSECHO true /* set to true to only log to SD when GPS has a fix, for debugging, keep it false */ #define LOG_FIXONLY false // Set the pins used #define chipSelect 10 #define ledPin 13 File logfile; // read a Hex value and return the decimal equivalent uint8_t parseHex(char c) { if (c < '0') return 0; if (c <= '9') return c - '0'; if (c < 'A') return 0; if (c <= 'F') return (c - 'A')+10; } // blink out an error code void error(uint8_t errno) { /* if (SD.errorCode()) { putstring("SD error: "); Serial.print(card.errorCode(), HEX); Serial.print(','); Serial.println(card.errorData(), HEX); } */ while(1) { uint8_t i; for (i=0; i