3rd year group project. Electronic and Electrical Engineering. Heriot-Watt University. This is the code for the mbed for the Automatic Little Object Organiser (ALOO).

Dependencies:   MCP23017 TCS3472_I2C WattBob_TextLCD mbed

Revision:
11:0fe833f8a1ab
Parent:
10:16ba52f8e025
Child:
14:cf2f255b5560
--- a/globals.cpp	Wed Nov 18 16:09:52 2015 +0000
+++ b/globals.cpp	Sat Nov 21 18:52:07 2015 +0000
@@ -47,7 +47,7 @@
 void hazBlock(CommandTypeRaw typeRaw)
 {
     if (typeRaw == Set) {
-        pc.printf("setting new haz block.\n");
+        pc.printf("Setting new haz block.\n");
 //        pc.printf("Send 'y' when block is inserted.\n");
         int lowerBeam = 0;
         int higherBeam = 0;
@@ -69,9 +69,6 @@
         } while (lowerBeam != 1);
         higherBeam = fpga->checkForSize();
 
-        
-
-
         _HazBlock = Block();
         if (higherBeam == 1)
             _HazBlock.size = Block::Big;
@@ -84,7 +81,7 @@
         fpga->moveSortingServo(Haz);
         fpga->moveStoppingServo(Go);
         while (fpga->checkForBlock()) {}
-        fpga->moveStoppingServo(Go);
+        fpga->moveStoppingServo(Stop);
         fpga->moveSortingServo(NonHaz);
 		
         pc.printf(	"HazBlock:\n \t Size:%i\n \t Real Colour:%i,%i,%i,%i\n \tMin Colour:%i,%i,%i,%i\n \t Max Colour:%i,%i,%i,%i\n ", _HazBlock.size, colourValue[0], colourValue[1], colourValue[2], colourValue[3], _HazBlock.minColour.components[Colour::Red], _HazBlock.minColour.components[Colour::Blue], _HazBlock.minColour.components[Colour::Green], _HazBlock.minColour.components[Colour::Alpha], _HazBlock.maxColour.components[Colour::Red], _HazBlock.maxColour.components[Colour::Blue], _HazBlock.maxColour.components[Colour::Green], _HazBlock.maxColour.components[Colour::Alpha]);