Object <- HardwareButton |
|
|
ButtonAction ButtonPushed ResetClass |
|
TimePushed TimeReleased |
| Field | Type | |
|---|---|---|
| HardwareButton: | timePushed: | Unsigned |
| timeReleased: | Unsigned |
instance HardwareButton tag; timePushed: 0; timeReleased: 0; end instance;
#endif Define Class HardwareButton; inherits from Object; field timePushed: Unsigned, getter; field timeReleased: Unsigned, getter; overrides ResetClass; attribute TimePushed: Unsigned, readOnly; attribute TimeReleased: Unsigned, readOnly; operation ButtonPushed(): Boolean, noFail; operation ButtonAction(pushed: Boolean); // Called when Button changes state // sends TRUE when pushed, FALSE when released end class;