2018 revision to classic DataBus AVC code.
Dependencies: LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell
Diff: main.cpp
- Revision:
- 16:eb28d0f64a9b
- Parent:
- 15:35c40765f7c3
- Child:
- 18:3f8a8f6e3cc1
--- a/main.cpp Thu Dec 13 00:30:59 2018 +0000 +++ b/main.cpp Thu Dec 13 17:35:29 2018 +0000 @@ -6,12 +6,14 @@ #include "mbed.h" #include <stdio.h> #include <errno.h> +#include "pinouts.h" #include "stats_report.h" #include "SDBlockDevice.h" #include "FATFileSystem.h" #include "SimpleShell.h" #include "Config.h" #include "Updater.h" +#include "Ublox6.h" Serial pc(USBTX, USBRX); //SDBlockDevice bd(p5, p6, p7, p8); // MOSI, MISO, CLK, CS @@ -21,6 +23,19 @@ SimpleShell sh; DigitalOut led1(LED1); +DigitalOut led3(LED3); + +void do_gps() { + Ublox6 ublox; + RawSerial s(UART1TX, UART1RX, 38400); + while (1) { + int c = s.getc(); + //int c = 'a'; + ublox.parse(c); + led3 = !led3; + } +} + /******** SHELL COMMANDS ********/ @@ -101,6 +116,10 @@ Thread updaterThread; updaterThread.set_priority(osPriorityRealtime); updaterThread.start(callback(u, &Updater::start)); + + printf("Starting gps...\n"); + Thread gpsThread; + gpsThread.start(&do_gps); /* FILE *fp;