// add this to the Header
String strID =""; // identifies GPS message type
attachInterrupt (0, handleInt, FALLING);
setSQW(0x10);
delay (2000);
pinMode(ledPin, OUTPUT);
//Add this to the end of the set up
// flush serial inp buffer
while(Serial1.available() > 0) {
char t = Serial1.read();
}
}
// Modify all the Serial Ports to this method, note where clear
// the string is located
//echo sounder
if (stringComplete1){
strID=(dataString1.substring(0,1));
// Serial.println(strID);
if (strID == "$"){
Serial.print(dataString1);
File dataFile = SD.open("datalog.txt", FILE_WRITE);
// if the file is available, write to it:
if (dataFile) {
dataFile.print(dt);
dataFile.print(" ");
dataFile.print(tm);
dataFile.print(msec);
dataFile.print(",");
dataFile.print(dataString1);
dataFile.close();
} else {
Serial.println("error opening datalog.txt");
} }
// clear the string:
dataString1 = "";
stringComplete1 = false;
strID="";
}
by Duane Benson
by Aaron Carman
by Aaron Carman