/********************************************************************* SCULLCOM Hobby Electronics 10MHz GPS linked Frequency Standard Software version 1.0v *********************************************************************/ // LCD RS pin to digital pin 7 // LCD Enable pin to digital pin 8 // LCD D4 pin to digital pin 9 // LCD D5 pin to digital pin 10 // LCD D6 pin to digital pin 11 // LCD D7 pin to digital pin 12 // LCD R/W pin connect to ground // include the library code: #include #include #include LiquidCrystal lcd(7, 8, 9, 10, 11, 12); // (RS, E, D4, D5, D6, D7) TinyGPS gps; SoftwareSerial nss(3, 4); // TX = 3 and RX = 4 void gpsdump(TinyGPS &gps); bool feedgps(); void setup() { nss.begin(9600); lcd.begin(16, 2); lcd.print("SCULLCOM"); lcd.setCursor(0,1); lcd.print("Freq Standard"); delay(3000); lcd.clear(); } void loop() { bool newdata = false; unsigned long start = millis(); while(millis() - start < 1000){ if (feedgps()) newdata = true; } if (newdata) { lcd.setCursor(0,0); lcd.print(" Sats :"); lcd.print(gps.satellites()); lcd.setCursor(8,1); lcd.print("LOCKED "); }else{ lcd.setCursor(0,0); lcd.print("No Signal "); lcd.setCursor(8,1); lcd.print("UNLOCKED"); } lcd.setCursor(0,1); lcd.print("10 MHz"); } bool feedgps() { while (nss.available()) { if (gps.encode(nss.read())) return true; } return false; }