first publish
Dependents: CleaningMachine_Betago CleaningMachine_Betago clean_V1 CleaningM-Palm ... more
UI.h@0:da168b469315, 2016-02-15 (annotated)
- Committer:
- icyzkungz
- Date:
- Mon Feb 15 17:44:04 2016 +0000
- Revision:
- 0:da168b469315
first publish
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
icyzkungz | 0:da168b469315 | 1 | #ifndef UI_H |
icyzkungz | 0:da168b469315 | 2 | #define UI_H |
icyzkungz | 0:da168b469315 | 3 | |
icyzkungz | 0:da168b469315 | 4 | #include "mbed.h" |
icyzkungz | 0:da168b469315 | 5 | #include "pinconfig.h" |
icyzkungz | 0:da168b469315 | 6 | #include "SystemStateConfig.h" |
icyzkungz | 0:da168b469315 | 7 | |
icyzkungz | 0:da168b469315 | 8 | #define UI_DEBUG |
icyzkungz | 0:da168b469315 | 9 | |
icyzkungz | 0:da168b469315 | 10 | class UI |
icyzkungz | 0:da168b469315 | 11 | { |
icyzkungz | 0:da168b469315 | 12 | public: |
icyzkungz | 0:da168b469315 | 13 | //UI(); |
icyzkungz | 0:da168b469315 | 14 | UI(PinName,PinName,PinName,PinName,PinName,PinName); |
icyzkungz | 0:da168b469315 | 15 | int LEDState(); |
icyzkungz | 0:da168b469315 | 16 | void LEDWalkOnOff(int,int,int); |
icyzkungz | 0:da168b469315 | 17 | |
icyzkungz | 0:da168b469315 | 18 | void SwWalk1Tick(); |
icyzkungz | 0:da168b469315 | 19 | void SwWalk2Tick(); |
icyzkungz | 0:da168b469315 | 20 | void SwWalk3Tick(); |
icyzkungz | 0:da168b469315 | 21 | |
icyzkungz | 0:da168b469315 | 22 | void SwSweepTick(); |
icyzkungz | 0:da168b469315 | 23 | void SwWaterTick(); |
icyzkungz | 0:da168b469315 | 24 | void SwEmergencyPush(); |
icyzkungz | 0:da168b469315 | 25 | void SwEmergencyRelease(); |
icyzkungz | 0:da168b469315 | 26 | |
icyzkungz | 0:da168b469315 | 27 | void BatteryBarLevel(); |
icyzkungz | 0:da168b469315 | 28 | void VelocityBarLevel(); |
icyzkungz | 0:da168b469315 | 29 | |
icyzkungz | 0:da168b469315 | 30 | void RunSystem(); |
icyzkungz | 0:da168b469315 | 31 | |
icyzkungz | 0:da168b469315 | 32 | bool getEmergencyStatus() { |
icyzkungz | 0:da168b469315 | 33 | return EmergencyCheck; |
icyzkungz | 0:da168b469315 | 34 | } |
icyzkungz | 0:da168b469315 | 35 | int getSystemState() { |
icyzkungz | 0:da168b469315 | 36 | return SystemState; |
icyzkungz | 0:da168b469315 | 37 | } |
icyzkungz | 0:da168b469315 | 38 | |
icyzkungz | 0:da168b469315 | 39 | private: |
icyzkungz | 0:da168b469315 | 40 | Serial *pc; |
icyzkungz | 0:da168b469315 | 41 | BusOut *VelocityBar,*BatteryBar; |
icyzkungz | 0:da168b469315 | 42 | DigitalOut *LedWalk1, *LedWalk2, *LedWalk3, *LedSweep, *LedWater, *LedStatus; |
icyzkungz | 0:da168b469315 | 43 | |
icyzkungz | 0:da168b469315 | 44 | DigitalIn SwWalk1, SwWalk2, SwWalk3, SwSweep, SwWater; |
icyzkungz | 0:da168b469315 | 45 | InterruptIn SwEmergency; |
icyzkungz | 0:da168b469315 | 46 | |
icyzkungz | 0:da168b469315 | 47 | |
icyzkungz | 0:da168b469315 | 48 | //Timer t; |
icyzkungz | 0:da168b469315 | 49 | //float now; |
icyzkungz | 0:da168b469315 | 50 | //float last; |
icyzkungz | 0:da168b469315 | 51 | |
icyzkungz | 0:da168b469315 | 52 | volatile int count[3]; |
icyzkungz | 0:da168b469315 | 53 | |
icyzkungz | 0:da168b469315 | 54 | bool EmergencyCheck; |
icyzkungz | 0:da168b469315 | 55 | |
icyzkungz | 0:da168b469315 | 56 | bool state[2]; |
icyzkungz | 0:da168b469315 | 57 | |
icyzkungz | 0:da168b469315 | 58 | int last_state; |
icyzkungz | 0:da168b469315 | 59 | int now_state; |
icyzkungz | 0:da168b469315 | 60 | |
icyzkungz | 0:da168b469315 | 61 | int SystemState; |
icyzkungz | 0:da168b469315 | 62 | |
icyzkungz | 0:da168b469315 | 63 | |
icyzkungz | 0:da168b469315 | 64 | |
icyzkungz | 0:da168b469315 | 65 | }; |
icyzkungz | 0:da168b469315 | 66 | |
icyzkungz | 0:da168b469315 | 67 | #endif |