Add platform - Wizwiki-W7500

Dependencies:   GPS mbed

Fork of GPS_HelloWorld by Boris Adryan

알아두기

사용제품 및 프로그램

하드웨어 구성

아래의 그림과 같이 연결하면 된다. https://socatelier.files.wordpress.com/2015/07/2_gps_746_lrg.jpg

WIZwiki-W7500GPS
3.3VVin
GNDGND
D0TX
D1RX

소프트웨어 구성

Link : https://developer.mbed.org/users/eunkyoungkim/code/GPS_OLED_HelloWorld

아래는 mbed Web compiler에서 사용한 Source Code이다. 위의 링크로 가면 GPS의 Library도 같이 볼수 있다.

include the mbed library with this snippet

/* Example showing how to hook up to different GPS modules (GlobalSat EM406a and Adafruit Ultimate GPSv3)
*  to emulated serial ports at different speeds */
#include "mbed.h"
#include "GPS.h"
 
 
#ifdef TARGET_WIZwiki_W7500
    GPS gpsAda(D1, D0, 9600);
#else
    GPS gpsAda(P0_12, P0_15, 9600);
    GPS gpsSpark(P0_4, P0_0, 4800);
#endif
 
Serial pc(USBTX, USBRX);
 
int main() {
    char ch[] = {"Adafruit"};
    char ch1[] = {"Sparkfun Breakout"};
    
    while (1) {  
#ifndef TARGET_WIZwiki_W7500      
       if(gpsSpark.sample()) {
          pc.printf("set %s\t%f\t%f\t%f\t%f\t%f\n\r", ch1, gpsSpark.longitude, gpsSpark.latitude, gpsSpark.alt, gpsSpark.geoid, gpsSpark.time);
       }
#endif  
       if(gpsAda.sample()) {
          pc.printf("set %s\t%f\t%f\t%f\t%f\t%f\r\n",  ch, gpsAda.longitude, gpsAda.latitude, gpsAda.alt, gpsAda.geoid, gpsAda.time);
        }
        
    }
    
}

결과

현재 내가 있는 위치의 GPS정보이다. https://socatelier.files.wordpress.com/2015/07/3_gps.png

아래의 그림은 구글 지도에서의 GPS정보이다.

https://socatelier.files.wordpress.com/2015/07/ecbaa1ecb298_2015_07_27_16_56_50_68.png

표로 정리하면 아래와 같다.

Terminalgoogle map
latitude(위도)37.37854037.378633
longitude(경도)127.112206127.113032
Revision:
1:bf6b98a2e480
Parent:
0:6b7345059afe
Child:
2:9077ee09f54e
--- a/main.cpp	Tue Jun 08 14:12:30 2010 +0000
+++ b/main.cpp	Sat Nov 02 16:27:23 2013 +0000
@@ -1,15 +1,24 @@
+/* Example showing how to hook up to different GPS modules (GlobalSat EM406a and Adafruit Ultimate GPSv3)
+*  to emulated serial ports at different speeds */
 #include "mbed.h"
 #include "GPS.h"
 
+GPS gpsSpark(P0_4, P0_0, 4800);
+GPS gpsAda(P0_12, P0_15, 9600);
+
 Serial pc(USBTX, USBRX);
-GPS gps(p9, p10);
 
 int main() {
-    while(1) {
-        if(gps.sample()) {
-            pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
-        } else {
-            pc.printf("Oh Dear! No lock :(\n");
+    while (1) {  
+      
+       if(gpsSpark.sample()) {
+          pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Sparkfun Breakout', gpsSpark.longitude, gpsSpark.latitude, gpsSpark.alt, gpsSpark.geoid, gpsSpark.time);
+       }
+  
+       if(gpsAda.sample()) {
+          pc.printf("set %d\t%c\t%f\t%f\t%f\t%f\t%f\n\r", takes, 'Adafruit', gpsAda.longitude, gpsAda.latitude, gpsAda.alt, gpsAda.geoid, gpsAda.time);
         }
+        
     }
-}
+    
+}
\ No newline at end of file