Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.

Dependencies:   Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo

Committer:
shimniok
Date:
Wed Jun 20 14:57:48 2012 +0000
Revision:
0:826c6171fc1b
Updated documentation

Who changed what in which revision?

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