added logging dump sketch

This commit is contained in:
Ladyada 2012-04-17 11:42:20 -04:00
parent df8764f196
commit 47b173d6b2
3 changed files with 64 additions and 3 deletions

View File

@ -31,6 +31,8 @@ All text above must be included in any redistribution
#define PMTK_SET_NMEA_OUTPUT_RMCGGA "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28" #define PMTK_SET_NMEA_OUTPUT_RMCGGA "$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
// turn on ALL THE DATA // turn on ALL THE DATA
#define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28" #define PMTK_SET_NMEA_OUTPUT_ALLDATA "$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
// turn off output
#define PMTK_SET_NMEA_OUTPUT_OFF "$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28"
// to generate your own sentences, check out the MTK command datasheet and use a checksum calculator // to generate your own sentences, check out the MTK command datasheet and use a checksum calculator
// such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html // such as the awesome http://www.hhhh.org/wiml/proj/nmeaxor.html

View File

@ -0,0 +1,60 @@
// Test code for Adafruit GPS modules using MTK3329/MTK3339 driver
//
// This code turns on the LOCUS built-in datalogger. The datalogger
// turns off when power is lost, so you MUST turn it on every time
// you want to use it!
//
// Tested and works great with the Adafruit Ultimate GPS module
// using MTK33x9 chipset
// ------> http://www.adafruit.com/products/746
// Pick one up today at the Adafruit electronics shop
// and help support open source hardware & software! -ada
#include <Adafruit_GPS.h>
// these are for Arduino 1.0
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2);
// if using Arduino v23 or earlier, uncomment these
// two lines and comment out the above. You will
// need to install NewSoftSerial
// #include <NewSoftSerial.h>
// NewSoftSerial mySerial(3, 2);
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// Connect the GPS TX (transmit) pin to Digital 3
// Connect the GPS RX (receive) pin to Digital 2
Adafruit_GPS GPS(&mySerial);
void setup()
{
// connect at 115200 so we can read the GPS fast enuf and
// also spit it out
Serial.begin(115200);
Serial.println("Adafruit GPS logging start test!");
// 9600 NMEA is the default baud rate for MTK - some use 4800
GPS.begin(9600);
GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_OFF);
while (mySerial.available())
mySerial.read();
delay(1000);
GPS.sendCommand("$PMTK622,1*29");
Serial.println("----------------------------------------------------");
}
void loop() // run over and over again
{
if (mySerial.available()) {
char c = mySerial.read();
if (c) UDR0 = c;
}
}

View File

@ -56,8 +56,8 @@ void setup()
// every 1 millisecond, and read data from the GPS for you. that makes the // every 1 millisecond, and read data from the GPS for you. that makes the
// loop code a heck of a lot easier! // loop code a heck of a lot easier!
useInterrupt(true); useInterrupt(true);
delay(500);
Serial.print("STARTING LOGGING...."); Serial.print("\nSTARTING LOGGING....");
if (GPS.LOCUS_StartLogger()) if (GPS.LOCUS_StartLogger())
Serial.println(" STARTED!"); Serial.println(" STARTED!");
else else
@ -98,4 +98,3 @@ void useInterrupt(boolean v) {
} }