Colour sensors calibrated
Dependencies: mbed-rtos mbed Servo QEI
Fork of ICRSEurobot13 by
Others/EmergencyStop/EmergencyStop.h@2:45da48fab346, 2013-03-29 (annotated)
- Committer:
- twighk
- Date:
- Fri Mar 29 20:09:21 2013 +0000
- Revision:
- 2:45da48fab346
- Child:
- 3:717de74f6ebd
Emergency Stop Button, Derive all actuator classes from the base class, and implement a virtual halt function that releases power from them
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
twighk | 2:45da48fab346 | 1 | |
twighk | 2:45da48fab346 | 2 | // Eurobot13 EmergencyStop.h |
twighk | 2:45da48fab346 | 3 | |
twighk | 2:45da48fab346 | 4 | #include "mbed.h" |
twighk | 2:45da48fab346 | 5 | #include "Actuators/Actuator.h" |
twighk | 2:45da48fab346 | 6 | |
twighk | 2:45da48fab346 | 7 | class EmergencyStop : public InterruptIn{ |
twighk | 2:45da48fab346 | 8 | private: |
twighk | 2:45da48fab346 | 9 | public: |
twighk | 2:45da48fab346 | 10 | EmergencyStop ( PinName pin |
twighk | 2:45da48fab346 | 11 | , void (*risefunction)(void) = Actuator::haltandCatchFire |
twighk | 2:45da48fab346 | 12 | , void (*fallfunction)(void) = Actuator::haltandCatchFire |
twighk | 2:45da48fab346 | 13 | ) |
twighk | 2:45da48fab346 | 14 | : InterruptIn(pin) |
twighk | 2:45da48fab346 | 15 | { |
twighk | 2:45da48fab346 | 16 | if (risefunction != NULL){ |
twighk | 2:45da48fab346 | 17 | rise(risefunction); |
twighk | 2:45da48fab346 | 18 | } |
twighk | 2:45da48fab346 | 19 | |
twighk | 2:45da48fab346 | 20 | if (fallfunction != NULL){ |
twighk | 2:45da48fab346 | 21 | fall(fallfunction); |
twighk | 2:45da48fab346 | 22 | } |
twighk | 2:45da48fab346 | 23 | } |
twighk | 2:45da48fab346 | 24 | }; |