ok

Dependencies:   GroveGPS

Files at this revision

API Documentation at this revision

Comitter:
stersky
Date:
Tue Feb 12 14:51:04 2019 +0000
Parent:
0:39b09b3d8731
Commit message:
ok

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 39b09b3d8731 -r 4939dd38bafd main.cpp
--- a/main.cpp	Tue Jan 30 13:47:17 2018 -0600
+++ b/main.cpp	Tue Feb 12 14:51:04 2019 +0000
@@ -1,44 +1,36 @@
-// ----------------------------------------------------------------------------
-// Copyright 2016-2017 ARM Ltd.
-//
-// SPDX-License-Identifier: Apache-2.0
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ----------------------------------------------------------------------------
 
 #include "mbed.h"
 
 #include "GroveGPS.h"
 
-Serial gps_serial(D1, D0, 9600);
+Serial gps_serial(p9, p10, 9600);
+Serial pc(USBTX, USBRX); //Initialise une liason série via le connecteur USB du pc
 
 Thread gpsThread;
 GroveGPS gps;
 
 // Runs at 1Hz and updates the GPS location every second
 void gps_updater_thread() {
+    char i;
     while(true) {
         char latBuffer[16], lonBuffer[16];
         gps.getLatitude(latBuffer);
         gps.getLongitude(lonBuffer);
 
         // Utilize latitude and longitude values here
-        printf("Latitude: %f\n, Longitude: %f\n", latBuffer, lonBuffer);
+        pc.printf("Latitude: %s, Longitude: %s\n\r", latBuffer, lonBuffer);
+        /*for(i=0;i<16;i++)
+        {
+            pc.printf("%c ",latBuffer[i]);
+        }
+        pc.printf("\n\r");*/
         wait(1);
     }
 }
 
 int main() {
+    
+    pc.baud(115200);//Initialise la vitesse de la communication série
 
     // Start a thread to get updated GPS values
     gpsThread.start(gps_updater_thread);