![](/media/cache/profiles/28e53af64ac756be64ef67d3287313de.jpg.50x50_q85.jpg)
uuu
Dependencies: mbed HMC5883L GPS
Revision 0:d3f572b3aa25, committed 2019-03-20
- Comitter:
- sliackystefan
- Date:
- Wed Mar 20 11:18:33 2019 +0000
- Commit message:
- uuu
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GPS.lib Wed Mar 20 11:18:33 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/sliackystefan/code/GPS/#7908d7196d1e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/HMC5883L.lib Wed Mar 20 11:18:33 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/tylerjw/code/HMC5883L/#bc4e1201e092
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Mar 20 11:18:33 2019 +0000 @@ -0,0 +1,46 @@ +#include "mbed.h" +#include "GPS.h" +#include "HMC5883L.h" + +Serial pc(SERIAL_TX, SERIAL_RX); +GPS ark(PA_9, PA_10); +DigitalOut myled(LED1); +HMC5883L compass(D14, D15); + +int main() +{ + pc.baud(9600); + pc.printf("l"); + int16_t data[3] = {0}; + double heading = 0.0f; + + compass.init(); + while(1) + { + compass.getXYZ(data); + wait(0.1f); + heading = compass.getHeadingXYDeg(); + pc.printf("x: %4d, y: %4d, z: %4d\r\n", data[0], data[1], data[2]); + pc.printf("heading: %0.2f\r\n", heading); + wait(1.0f); + + if( ark.sample() == 1) + { + myled=0; + float latitude = ark.latitude; + float longitude = ark.longitude; + float latitudeB = ark.latitudeB; + float longitudeA = ark.longitudeA; + float utc = ark.utc + 50000; + pc.printf("latitude: %0.6f, longitude: %0.6f, latitudeRAW: %0.6f, longitudeRAW: %0.6f, utc: %f\r\n",latitude,longitude,latitudeB,longitudeA,utc); + wait(1); + } + else + { + myled=1; + } + } +} + + + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Mar 20 11:18:33 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc \ No newline at end of file