ICRS Eurobot 2013

Dependencies:   mbed mbed-rtos Servo QEI

Revision:
10:1f0cf0182067
Parent:
7:4340355261f9
Parent:
8:69bdf20cb525
Child:
11:bbddc908c78c
--- a/main.cpp	Fri Apr 05 16:37:36 2013 +0000
+++ b/main.cpp	Fri Apr 05 16:40:52 2013 +0000
@@ -1,4 +1,4 @@
-#pragma Otime // Compiler Optimisations
+//#pragma Otime // Compiler Optimisations
 
 // Eurobot13 main.cpp
 
@@ -67,6 +67,7 @@
 #include "Actuators/MainMotors/MainMotor.h"
 #include "Sensors/Encoders/Encoder.h"
 #include "Sensors/Colour/Colour.h"
+#include "Sensors/CakeSensor/CakeSensor.h"
 
 
 
@@ -81,6 +82,7 @@
 void phototransistortest();
 void ledphototransistortest();
 void colourtest();
+void cakesensortest();
 
 int main() {
     
@@ -98,6 +100,18 @@
     //phototransistortest();
     //ledphototransistortest();
     //colourtest(); // Red SnR too low
+    cakesensortest();
+}
+
+void cakesensortest(){
+    wait(1);
+    pc.printf("cakesensortest");
+    
+    CakeSensor cs(p20);
+    while(true){
+        wait(0.1);
+        pc.printf("distance: %f\t %f\r\n", cs.Distance(),cs.Distanceincm());
+        }
 }
 
 void colourtest(){