mbed2 zad 5b
Dependencies: LCD_DISCO_F429ZI mbed BSP_DISCO_F429ZI
SERVO_GUI/ServoGui.h@5:cafab5a4d1c9, 2020-06-09 (annotated)
- Committer:
- krzysiek99
- Date:
- Tue Jun 09 12:30:01 2020 +0000
- Revision:
- 5:cafab5a4d1c9
- Parent:
- 4:7855d3ab4c15
mbed2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
krzysiek99 | 4:7855d3ab4c15 | 1 | #ifndef SERVO_GUI_H |
krzysiek99 | 4:7855d3ab4c15 | 2 | #define SERVO_GUI_H |
krzysiek99 | 4:7855d3ab4c15 | 3 | #include "LCD_DISCO_F429ZI.h" |
krzysiek99 | 4:7855d3ab4c15 | 4 | enum Direction{LEFT, RIGHT}; |
krzysiek99 | 4:7855d3ab4c15 | 5 | enum DetectorState{ACTIVE, INACTIVE}; |
krzysiek99 | 4:7855d3ab4c15 | 6 | class ServoGui |
krzysiek99 | 4:7855d3ab4c15 | 7 | { |
krzysiek99 | 4:7855d3ab4c15 | 8 | public: |
krzysiek99 | 4:7855d3ab4c15 | 9 | ServoGui(unsigned int uiDetectorInitialPosition = 0); |
krzysiek99 | 4:7855d3ab4c15 | 10 | void LedStepLeft(void); |
krzysiek99 | 4:7855d3ab4c15 | 11 | void LedStepRight(void); |
krzysiek99 | 4:7855d3ab4c15 | 12 | void DetectorStepLeft(void); |
krzysiek99 | 4:7855d3ab4c15 | 13 | void DetectorStepRight(void); |
krzysiek99 | 4:7855d3ab4c15 | 14 | DetectorState eDetectorRead(void); |
krzysiek99 | 4:7855d3ab4c15 | 15 | private: |
krzysiek99 | 4:7855d3ab4c15 | 16 | LCD_DISCO_F429ZI lcd; |
krzysiek99 | 4:7855d3ab4c15 | 17 | unsigned char ucLedPosition; |
krzysiek99 | 4:7855d3ab4c15 | 18 | unsigned int uiDetectorPosition; |
krzysiek99 | 4:7855d3ab4c15 | 19 | void DrawBackground(void); |
krzysiek99 | 4:7855d3ab4c15 | 20 | void DrawMotor(void); |
krzysiek99 | 4:7855d3ab4c15 | 21 | void DrawDetectorPosition(unsigned int uiPosition); |
krzysiek99 | 4:7855d3ab4c15 | 22 | void DrawLeds(void); |
krzysiek99 | 4:7855d3ab4c15 | 23 | void ClearLeds(void); |
krzysiek99 | 4:7855d3ab4c15 | 24 | void SetLed(unsigned char ucLedNumber); |
krzysiek99 | 4:7855d3ab4c15 | 25 | void StepLed(Direction eDirection); |
krzysiek99 | 4:7855d3ab4c15 | 26 | }; |
krzysiek99 | 4:7855d3ab4c15 | 27 | #else |
krzysiek99 | 4:7855d3ab4c15 | 28 | #error "This class was definied previously" |
krzysiek99 | 4:7855d3ab4c15 | 29 | #endif |