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:
27:47a7bc902587
Parent:
22:8f11d1c178ab
--- a/stateMachine.h	Thu Dec 04 12:31:23 2014 +0000
+++ b/stateMachine.h	Thu Dec 04 22:05:18 2014 +0000
@@ -1,52 +1,8 @@
-
+/*  enum StateMachine{
+ *  An enumerated type representing the maintenance mode slider operations.
+ */
 enum StateMachine{
     
-    //Initializing state
-    INITIALISING,
-    
-    //Stored value states
-    READING_RGB_VALUES,     //read stored values from MBED datafile
-    WRITING_RGB_VALUES,     //write stored values to MBED datafile
-    INCREMENT_RED,
-    INCREMENT_GREEN,
-    INCREMENT_BLUE,
-    DECREMENT_RED,
-    DECREMENT_GREEN,
-    DECREMENT_BLUE,
-    
-    
-    //Dispensing states
-    DISPENSE_RED,
-    DISPENSE_GREEN,
-    DISPENSE_BLUE,
-    DISPENSE_ALL,
-    //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.
-    
-    //PC States
-    WAITING_FOR_ACK,
-    WAITING_FOR_CHAR,
-    //External LCD States
-    
     //Maintenance mode states
     RB_LEFT,
     RB_CENTRE,