#include #ifdef __AVR__ #include #include #endif #include #include // Ladyada's logger modified by Bill Greiman to use the SdFat library // // This code shows how to listen to the GPS module in an interrupt // which allows the program to have more 'freedom' - just parse // when a new NMEA sentence is available! Then access data when // desired. // // Tested and works great with the Adafruit Ultimate GPS Shield // using MTK33x9 chipset // ------> http://www.adafruit.com/products/ // Pick one up today at the Adafruit electronics shop // and help support open source hardware & software! -ada #ifdef __AVR__ SoftwareSerial mySerial(8, 7); #else #define mySerial Serial1 #endif 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