The MBED firmware used on the Chipin sorter, developed over 12 weeks for a 3rd year university systems project. Chipin is a token sorter, it sorts tokens by colours and dispenses them to order through an online booking system and card reader. This program interfaces with an FPGA, PC and LCD screen to control the sorter. The sorter has an operation mode where it can process orders when a card is entered into the machine. There is also a maintenance mode where the device responds to maintenance instructions such as 'dispense all'. More information at http://www.ionsystems.uk/

Dependencies:   MCP23017 TCS3472_I2C WattBob_TextLCD mbed-rtos mbed

Revision:
7:6ba00694f9cd
Parent:
6:e64796f1f384
Child:
8:b7771391adc9
--- a/stateMachine.h	Fri Nov 07 20:16:23 2014 +0000
+++ b/stateMachine.h	Mon Nov 10 15:03:20 2014 +0000
@@ -1,7 +1,40 @@
-enum stateMachine{
-    RED,
-    GREEN,
-    BLUE,
-    BIN,
-    OTHER;
+enum StateMachine{
+    
+    //Initializing state
+    INITIALISING,
+    
+    //File States
+    READING_RGB_VALUES,
+    WRITING_RGB_VALUES,
+    
+    //Dispensing states
+    DISPENSE_RED,
+    DISPENSE_GREEN,
+    DISPENSE_BLUE,
+    
+    //Sorting states
+    SORT_RED,
+    SORT_GREEN,
+    SORT_BLUE,
+    SORT_BIN,
+    SORT_RECYCLE,
+    
+    //Card reader states
+    READ_CARD,
+    WAITING_FOR_CARD,
+    WAITING_FOR_DATABASE,
+    RECIEVING_AMOUNTS,      //The MBED is recieving the number of each colour of token to dispense.
+    
+    //MBED LCD states
+    DISPLAY_WELCOME,        //Display a welcome message.
+    DISPLAY_AMOUNTS,        //Display the amount of tokens requested.
+    DISPLAY_LEVELS,         //Display the current sorted chip levels.
+    DISPLAY_LANGUAGE,       //Display the current language.
+    DISPLAY_COMPLETED,      //Display an 'order completed' message.
+    DISPLAY_SORTING,        //Display a 'currently sorting' message.
+    DISPLAY_DISPENSING,     //Display a 'dispensing' message.
+    
+    //External LCD States
+    
+    
     };
\ No newline at end of file