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: SoftSerial MAX14690 Buffer
Fork of rtos_threading_with_callback by
Diff: gpsTask.cpp
- Revision:
- 3:d7ec6dc025b0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpsTask.cpp Fri Mar 30 10:32:10 2018 +0000 @@ -0,0 +1,35 @@ +#include "mbed.h" +#include "GPS.h" +#include "rtos.h" +#include "global.h" + +class GpsTask +{ +public: + static void run() + { + for (;;) { + //printf("GPS task\r\n"); + if(gps.sample()>2) + { + float lon = gps.get_dec_longitude(); + printf("Sat: %u\r\n", gps.get_satelites()); + printf("%3.2f\r\n", lon); + } + //float lon = gps.get_dec_longitude(); + //printf("Sat: %u\r\n", gps.get_satelites()); + //printf("%3.2f\r\n", lon); + rtos::Thread::wait(250); + } + } + GpsTask() + { + registerThread(GpsTask::run); + //run(); + } + static GPS gps; +}; +GPS GpsTask::gps(P5_4, P5_3); + +// some witchcraft to register run function without touching anything outside our library +static GpsTask _dummy; \ No newline at end of file