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.
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
servo_gui.h
00001 #ifndef SERVO_GUI_H 00002 #define SERVO_GUI_H 00003 #include "LCD_DISCO_F429ZI.h" 00004 #include "mbed.h" 00005 00006 #define DISK_X 120 00007 #define DISK_Y 120 00008 #define DISK_RADIUS 100 00009 #define SMALL_DISK_RADIUS 20 00010 #define MAX_STEPS 16 00011 #define PI 3.14159 00012 #define LED_X 30 00013 #define LED_Y 290 00014 #define LED_DISTANCE 60 00015 #define LED_RADIUS 20 00016 #define DELAY 0.25 00017 00018 00019 enum eState {ON,OFF}; 00020 enum eDirection {LEFT,RIGHT}; 00021 00022 struct Servo { 00023 unsigned int uiCurrentPosition; 00024 unsigned int uiDesiredPosition; 00025 unsigned int uiPreviousPosition; 00026 }; 00027 00028 class ServoGui{ 00029 public: 00030 ServoGui(); 00031 void ServoCallib(); 00032 void ServoGoTo(uint8_t ui8Position); 00033 struct Servo sServo; 00034 private: 00035 LCD_DISCO_F429ZI lcd; 00036 uint8_t ui8ActualLedPoint; 00037 void DrawDisk(); 00038 enum eState eLedStates[3]; 00039 void LedOn(uint8_t ui8LedNumber); 00040 void DrawLed(uint8_t); 00041 enum eState eReadDetector(); 00042 void LedStep(enum eDirection eWhere); 00043 }; 00044 00045 00046 00047 00048 #endif
Generated on Sat Jul 16 2022 04:55:53 by
1.7.2