Code for autonomous rover for Sparkfun AVC. DataBus won 3rd in 2012 and the same code was used on Troubled Child, a 1986 Jeep Grand Wagoneer to win 1st in 2014.

Dependencies:   mbed Watchdog SDFileSystem DigoleSerialDisp

Committer:
shimniok
Date:
Fri Nov 30 16:11:53 2018 +0000
Revision:
25:bb5356402687
Parent:
0:a6a169de725f
Initial publish of revised version.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimniok 0:a6a169de725f 1 #include "GPSStatus.h"
shimniok 0:a6a169de725f 2
shimniok 0:a6a169de725f 3 #define WIDTH 8
shimniok 0:a6a169de725f 4 #define HEIGHT 9
shimniok 0:a6a169de725f 5
shimniok 0:a6a169de725f 6 SerialGraphicLCD *GPSStatus::lcd = 0;
shimniok 0:a6a169de725f 7
shimniok 0:a6a169de725f 8 GPSStatus::GPSStatus(int x, int y):
shimniok 0:a6a169de725f 9 _x(x), _y(y)
shimniok 0:a6a169de725f 10 {
shimniok 0:a6a169de725f 11 }
shimniok 0:a6a169de725f 12
shimniok 0:a6a169de725f 13 void GPSStatus::init()
shimniok 0:a6a169de725f 14 {
shimniok 0:a6a169de725f 15 if (lcd) {
shimniok 0:a6a169de725f 16 lcd->pixel(_x+1, _y+1, true);
shimniok 0:a6a169de725f 17 lcd->pixel(_x+2, _y+1, true);
shimniok 0:a6a169de725f 18 lcd->pixel(_x+3, _y+1, true);
shimniok 0:a6a169de725f 19 lcd->pixel(_x+2, _y+2, true);
shimniok 0:a6a169de725f 20 lcd->pixel(_x+2, _y+3, true);
shimniok 0:a6a169de725f 21 lcd->pixel(_x+3, _y+3, true);
shimniok 0:a6a169de725f 22 lcd->pixel(_x+4, _y+3, true);
shimniok 0:a6a169de725f 23 lcd->pixel(_x+2, _y+4, true);
shimniok 0:a6a169de725f 24 lcd->pixel(_x+5, _y+4, true);
shimniok 0:a6a169de725f 25 lcd->pixel(_x+1, _y+5, true);
shimniok 0:a6a169de725f 26 lcd->pixel(_x+3, _y+5, true);
shimniok 0:a6a169de725f 27 lcd->pixel(_x+1, _y+6, true);
shimniok 0:a6a169de725f 28 lcd->pixel(_x+2, _y+7, true);
shimniok 0:a6a169de725f 29 lcd->posXY(_x+10, _y);
shimniok 0:a6a169de725f 30 _last = 0;
shimniok 0:a6a169de725f 31 }
shimniok 0:a6a169de725f 32 }
shimniok 0:a6a169de725f 33
shimniok 0:a6a169de725f 34 void GPSStatus::update(float hdop)
shimniok 0:a6a169de725f 35 {
shimniok 0:a6a169de725f 36 lcd->pixel(_x+5, _y+1, hdop < 3.0);
shimniok 0:a6a169de725f 37
shimniok 0:a6a169de725f 38 lcd->pixel(_x+6, _y+1, hdop < 2.0);
shimniok 0:a6a169de725f 39 lcd->pixel(_x+6, _y+2, hdop < 2.0);
shimniok 0:a6a169de725f 40
shimniok 0:a6a169de725f 41 lcd->pixel(_x+7, _y+1, hdop < 1.5);
shimniok 0:a6a169de725f 42 lcd->pixel(_x+7, _y+2, hdop < 1.5);
shimniok 0:a6a169de725f 43 lcd->pixel(_x+7, _y+3, hdop < 1.5);
shimniok 0:a6a169de725f 44
shimniok 0:a6a169de725f 45 lcd->pixel(_x+8, _y+1, hdop < 1.1);
shimniok 0:a6a169de725f 46 lcd->pixel(_x+8, _y+2, hdop < 1.1);
shimniok 0:a6a169de725f 47 lcd->pixel(_x+8, _y+3, hdop < 1.1);
shimniok 0:a6a169de725f 48 lcd->pixel(_x+8, _y+4, hdop < 1.1);
shimniok 0:a6a169de725f 49
shimniok 0:a6a169de725f 50 return;
shimniok 0:a6a169de725f 51 }