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

Committer:
IonSystems
Date:
Thu Nov 20 22:02:54 2014 +0000
Revision:
14:31ba3e56c788
Parent:
12:814a8fdbb6f7
Child:
23:f9e7e64784be
Euan broke dispense mode

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IonSystems 6:e64796f1f384 1 #include "mbed.h"
IonSystems 12:814a8fdbb6f7 2
IonSystems 14:31ba3e56c788 3 int redAmount; //The amount of chips curs
IonSystems 6:e64796f1f384 4 int greenAmount;
IonSystems 6:e64796f1f384 5 int blueAmount;
IonSystems 14:31ba3e56c788 6 int dispensorSize = 24; //The maximum number of chips that can fit in one of the dispensor tubes.
IonSystems 6:e64796f1f384 7
IonSystems 6:e64796f1f384 8 void readChipNumbers(){
IonSystems 6:e64796f1f384 9 redAmount = readFile(0);
IonSystems 6:e64796f1f384 10 greenAmount = readFile(1);
IonSystems 6:e64796f1f384 11 blueAmount = readFile(2);
IonSystems 12:814a8fdbb6f7 12
IonSystems 6:e64796f1f384 13 }
IonSystems 6:e64796f1f384 14
IonSystems 6:e64796f1f384 15 void decrementRed(){
IonSystems 6:e64796f1f384 16 redAmount--;
IonSystems 6:e64796f1f384 17 }
IonSystems 6:e64796f1f384 18 void decrementGreen(){
IonSystems 6:e64796f1f384 19 greenAmount--;
IonSystems 6:e64796f1f384 20 }
IonSystems 6:e64796f1f384 21 void decrementBlue(){
IonSystems 6:e64796f1f384 22 blueAmount--;
IonSystems 6:e64796f1f384 23 }
IonSystems 6:e64796f1f384 24
IonSystems 6:e64796f1f384 25 void incrementRed(){
IonSystems 6:e64796f1f384 26 redAmount++;
IonSystems 6:e64796f1f384 27 }
IonSystems 6:e64796f1f384 28 void incrementGreen(){
IonSystems 6:e64796f1f384 29 greenAmount++;
IonSystems 6:e64796f1f384 30 }
IonSystems 6:e64796f1f384 31 void incrementBlue(){
IonSystems 6:e64796f1f384 32 blueAmount++;
IonSystems 6:e64796f1f384 33 }