Colour sensors calibrated

Dependencies:   mbed-rtos mbed Servo QEI

Fork of ICRSEurobot13 by Thomas Branch

Actuators/Actuator.h

Committer:
twighk
Date:
2013-04-03
Revision:
4:1be0f6c6ceae
Parent:
2:45da48fab346

File content as of revision 4:1be0f6c6ceae:

#ifndef __Actuator_h__
#define __Actuator_h__
// Eurobot13 Actuator.h

#include "mbed.h"

class Actuator {
    private:
    static Actuator *Head; // Actuator.cpp
    Actuator *next;
    
    public:
    Actuator(){
        next = NULL;
        if (Head == NULL){
            Head = this;
        } else {
            Actuator* nxt = Head;
            for(;nxt->next != NULL; nxt = nxt->next);
            nxt->next = this;
        }
    } 
    
    virtual void halt (void) = 0;
    
    static void haltandCatchFire(void){
        DigitalOut myled(LED1);
        myled = 1;
        //halt
        for(Actuator* nxt = Head; nxt != NULL; nxt = nxt->next){
            nxt->halt();
        }   
        //catchFire
        while(true);
    }


};

#endif