Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
GPSStatus.cpp
00001 #include "GPSStatus.h" 00002 00003 #define WIDTH 8 00004 #define HEIGHT 9 00005 00006 SerialGraphicLCD *GPSStatus::lcd = 0; 00007 00008 GPSStatus::GPSStatus(int x, int y): 00009 _x(x), _y(y) 00010 { 00011 } 00012 00013 void GPSStatus::init() 00014 { 00015 if (lcd) { 00016 lcd->pixel(_x+1, _y+1, true); 00017 lcd->pixel(_x+2, _y+1, true); 00018 lcd->pixel(_x+3, _y+1, true); 00019 lcd->pixel(_x+2, _y+2, true); 00020 lcd->pixel(_x+2, _y+3, true); 00021 lcd->pixel(_x+3, _y+3, true); 00022 lcd->pixel(_x+4, _y+3, true); 00023 lcd->pixel(_x+2, _y+4, true); 00024 lcd->pixel(_x+5, _y+4, true); 00025 lcd->pixel(_x+1, _y+5, true); 00026 lcd->pixel(_x+3, _y+5, true); 00027 lcd->pixel(_x+1, _y+6, true); 00028 lcd->pixel(_x+2, _y+7, true); 00029 lcd->posXY(_x+10, _y); 00030 _last = 0; 00031 } 00032 } 00033 00034 void GPSStatus::update(float hdop) 00035 { 00036 lcd->pixel(_x+5, _y+1, hdop < 3.0); 00037 00038 lcd->pixel(_x+6, _y+1, hdop < 2.0); 00039 lcd->pixel(_x+6, _y+2, hdop < 2.0); 00040 00041 lcd->pixel(_x+7, _y+1, hdop < 1.5); 00042 lcd->pixel(_x+7, _y+2, hdop < 1.5); 00043 lcd->pixel(_x+7, _y+3, hdop < 1.5); 00044 00045 lcd->pixel(_x+8, _y+1, hdop < 1.1); 00046 lcd->pixel(_x+8, _y+2, hdop < 1.1); 00047 lcd->pixel(_x+8, _y+3, hdop < 1.1); 00048 lcd->pixel(_x+8, _y+4, hdop < 1.1); 00049 00050 return; 00051 }
Generated on Tue Jul 12 2022 14:09:25 by 1.7.2