ICRS Eurobot 2013

Dependencies:   mbed mbed-rtos Servo QEI

Revision:
2:45da48fab346
Child:
4:1be0f6c6ceae
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Actuators/Actuator.h	Fri Mar 29 20:09:21 2013 +0000
@@ -0,0 +1,41 @@
+#ifndef __Actuator_h__
+#define __Actuator_h__
+// Eurobot13 Actuator.h
+
+#include "mbed.h"
+
+class Actuator {
+    private:
+    static Actuator *Head;
+    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){
+            //halt
+            for(Actuator* nxt = Head; nxt != NULL; nxt = nxt->next){
+                nxt->halt();
+            }
+            DigitalOut myled(LED1);
+            myled = 1;
+            
+            //catchFire
+            while(true);
+    }
+
+
+};
+
+#endif
\ No newline at end of file