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.
EACompass.h
00001 // Copyright 2010 Richard Parker 00002 00003 #ifndef MBED_EACOMPASS_H 00004 #define MBED_EACOMPASS_H 00005 00006 #include "mbed.h" 00007 00008 #include "EAWidget.h" 00009 00010 class EALCD; 00011 00012 /** 00013 * Class to handle displaying a button on screen with hitbox. 00014 * @author Richard Parker 00015 */ 00016 class EACompass: public EAWidget 00017 { 00018 public: 00019 EACompass( short x = 0, 00020 short y = 0, 00021 unsigned short diameter = 0, 00022 unsigned short angle = 0); 00023 00024 ~EACompass(); 00025 00026 virtual void paint(EALCD& lcd); 00027 void update(EALCD& lcd, float angle); 00028 00029 inline void setAngle(float angle) { _angle = angle; } 00030 inline float angle() { return _angle; } 00031 00032 inline void setDiameter(unsigned short diameter) { _diameter = diameter; EAWidget::setWidth(diameter); EAWidget::setHeight(diameter);} 00033 inline unsigned short diameter() { return _diameter; } 00034 00035 inline virtual void setWidth(unsigned short w) { setDiameter(w); } 00036 inline virtual void setHeight(unsigned short h) { setDiameter(h); } 00037 00038 private: 00039 float _angle; 00040 unsigned short _diameter; 00041 00042 void _drawPointer(EALCD& lcd); 00043 void _drawAngle(EALCD& lcd); 00044 00045 }; 00046 00047 #endif
Generated on Wed Jul 13 2022 10:26:51 by
1.7.2