![](/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
Diff: FPGAcomms.h
- Revision:
- 13:0661d658d9d1
- Parent:
- 12:814a8fdbb6f7
- Child:
- 14:31ba3e56c788
diff -r 814a8fdbb6f7 -r 0661d658d9d1 FPGAcomms.h --- a/FPGAcomms.h Mon Nov 17 21:31:42 2014 +0000 +++ b/FPGAcomms.h Thu Nov 20 11:15:47 2014 +0000 @@ -90,6 +90,7 @@ void dispense(Colour colour){ + bool validDispense = false; select = 0; //Setting to operation mode just in case it has not been set. dispenseBit1 = true; @@ -152,10 +153,14 @@ printLCD("DISPENSE COMPLETE"); + } } void sort(Colour colour){ + if(colour == NONE){ + return; + }else{ select = 0; //Setting to operation mode just in case it has not been set. colourBit1 = true; colourBit2 = true; @@ -225,7 +230,7 @@ colourBit3 = true; printLCD("SORT COMPLETE"); writeFile(redAmount,greenAmount,blueAmount); - + } } void dispenseAll(){