ICRS Eurobot 2013

Dependencies:   mbed mbed-rtos Servo QEI

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?

UserRevisionLine numberNew 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 };