Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: GPS TextLCD mbed
main.cpp
- Committer:
- narongdet
- Date:
- 2015-05-04
- Revision:
- 0:dfd102afb417
File content as of revision 0:dfd102afb417:
#include "mbed.h" #include "GPS.h" #include "TextLCD.h" GPS gps(PA_11,PA_12); I2C i2c_lcd(D14,D15); TextLCD_I2C lcd(&i2c_lcd, 0x4E, TextLCD::LCD16x2); int main() { lcd.setMode(TextLCD::DispOn); lcd.setBacklight(TextLCD::LightOff); lcd.setCursor(TextLCD::CurOff_BlkOff); lcd.setAddress(0,0); lcd.printf("Initial GPS...\n"); while(1){ if(gps.sample()) { lcd.setAddress(0,1); lcd.printf("%6.3f,%7.3f",gps.latitude,gps.longitude); } else { lcd.setAddress(0,1); lcd.printf("GPS not valid"); } wait(0.5); } }