![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
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
stateMachine.h@7:6ba00694f9cd, 2014-11-10 (annotated)
- Committer:
- IonSystems
- Date:
- Mon Nov 10 15:03:20 2014 +0000
- Revision:
- 7:6ba00694f9cd
- Parent:
- 6:e64796f1f384
- Child:
- 8:b7771391adc9
Started state machine
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
IonSystems | 7:6ba00694f9cd | 1 | enum StateMachine{ |
IonSystems | 7:6ba00694f9cd | 2 | |
IonSystems | 7:6ba00694f9cd | 3 | //Initializing state |
IonSystems | 7:6ba00694f9cd | 4 | INITIALISING, |
IonSystems | 7:6ba00694f9cd | 5 | |
IonSystems | 7:6ba00694f9cd | 6 | //File States |
IonSystems | 7:6ba00694f9cd | 7 | READING_RGB_VALUES, |
IonSystems | 7:6ba00694f9cd | 8 | WRITING_RGB_VALUES, |
IonSystems | 7:6ba00694f9cd | 9 | |
IonSystems | 7:6ba00694f9cd | 10 | //Dispensing states |
IonSystems | 7:6ba00694f9cd | 11 | DISPENSE_RED, |
IonSystems | 7:6ba00694f9cd | 12 | DISPENSE_GREEN, |
IonSystems | 7:6ba00694f9cd | 13 | DISPENSE_BLUE, |
IonSystems | 7:6ba00694f9cd | 14 | |
IonSystems | 7:6ba00694f9cd | 15 | //Sorting states |
IonSystems | 7:6ba00694f9cd | 16 | SORT_RED, |
IonSystems | 7:6ba00694f9cd | 17 | SORT_GREEN, |
IonSystems | 7:6ba00694f9cd | 18 | SORT_BLUE, |
IonSystems | 7:6ba00694f9cd | 19 | SORT_BIN, |
IonSystems | 7:6ba00694f9cd | 20 | SORT_RECYCLE, |
IonSystems | 7:6ba00694f9cd | 21 | |
IonSystems | 7:6ba00694f9cd | 22 | //Card reader states |
IonSystems | 7:6ba00694f9cd | 23 | READ_CARD, |
IonSystems | 7:6ba00694f9cd | 24 | WAITING_FOR_CARD, |
IonSystems | 7:6ba00694f9cd | 25 | WAITING_FOR_DATABASE, |
IonSystems | 7:6ba00694f9cd | 26 | RECIEVING_AMOUNTS, //The MBED is recieving the number of each colour of token to dispense. |
IonSystems | 7:6ba00694f9cd | 27 | |
IonSystems | 7:6ba00694f9cd | 28 | //MBED LCD states |
IonSystems | 7:6ba00694f9cd | 29 | DISPLAY_WELCOME, //Display a welcome message. |
IonSystems | 7:6ba00694f9cd | 30 | DISPLAY_AMOUNTS, //Display the amount of tokens requested. |
IonSystems | 7:6ba00694f9cd | 31 | DISPLAY_LEVELS, //Display the current sorted chip levels. |
IonSystems | 7:6ba00694f9cd | 32 | DISPLAY_LANGUAGE, //Display the current language. |
IonSystems | 7:6ba00694f9cd | 33 | DISPLAY_COMPLETED, //Display an 'order completed' message. |
IonSystems | 7:6ba00694f9cd | 34 | DISPLAY_SORTING, //Display a 'currently sorting' message. |
IonSystems | 7:6ba00694f9cd | 35 | DISPLAY_DISPENSING, //Display a 'dispensing' message. |
IonSystems | 7:6ba00694f9cd | 36 | |
IonSystems | 7:6ba00694f9cd | 37 | //External LCD States |
IonSystems | 7:6ba00694f9cd | 38 | |
IonSystems | 7:6ba00694f9cd | 39 | |
IonSystems | 6:e64796f1f384 | 40 | }; |