Gps
Dependencies: mbed
Fork of GPS_System_with_Google_Maps by
main.cpp@6:8cc48b05d20e, 2017-01-04 (annotated)
- Committer:
- fadi_lad
- Date:
- Wed Jan 04 15:52:24 2017 +0000
- Revision:
- 6:8cc48b05d20e
- Parent:
- 4:6ed9c8bb82c3
- Child:
- 7:73d911fc2bfa
gpsSerial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samux | 1:31e50fea8be8 | 1 | #include "mbed.h" |
Ifrah | 3:3c7906d60f89 | 2 | #include "GPS.h" |
fadi_lad | 6:8cc48b05d20e | 3 | Serial pc(A4, SERIAL_RX); |
Ifrah | 3:3c7906d60f89 | 4 | |
fadi_lad | 6:8cc48b05d20e | 5 | GPS ark(PA_9, PA_10); |
fadi_lad | 6:8cc48b05d20e | 6 | DigitalOut myled(LED1); |
Ifrah | 3:3c7906d60f89 | 7 | |
Ifrah | 3:3c7906d60f89 | 8 | int main() |
Ifrah | 3:3c7906d60f89 | 9 | { |
Ifrah | 3:3c7906d60f89 | 10 | while(1) { |
fadi_lad | 6:8cc48b05d20e | 11 | if( ark.sample() == 1) { |
fadi_lad | 6:8cc48b05d20e | 12 | myled=0; |
fadi_lad | 6:8cc48b05d20e | 13 | float latitude = ark.latitude; |
fadi_lad | 6:8cc48b05d20e | 14 | float longitude = ark.longitude; |
fadi_lad | 6:8cc48b05d20e | 15 | float utc =50000; |
fadi_lad | 6:8cc48b05d20e | 16 | pc.printf("latitude: %0.2f, longitude: %0.2f, utc: %f\r\n",latitude,longitude,utc); |
fadi_lad | 6:8cc48b05d20e | 17 | wait(1); |
Ifrah | 3:3c7906d60f89 | 18 | } else { |
fadi_lad | 6:8cc48b05d20e | 19 | myled=1; |
Ifrah | 3:3c7906d60f89 | 20 | } |
Ifrah | 3:3c7906d60f89 | 21 | } |
samux | 0:64c683256184 | 22 | } |