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
chipNumbers.h@23:f9e7e64784be, 2014-11-29 (annotated)
- Committer:
- IonSystems
- Date:
- Sat Nov 29 16:32:57 2014 +0000
- Revision:
- 23:f9e7e64784be
- Parent:
- 14:31ba3e56c788
- Child:
- 24:8868101d01d0
might be working
Who changed what in which revision?
User | Revision | Line number | New 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 | 23:f9e7e64784be | 6 | int recycleAmount; |
IonSystems | 14:31ba3e56c788 | 7 | int dispensorSize = 24; //The maximum number of chips that can fit in one of the dispensor tubes. |
IonSystems | 6:e64796f1f384 | 8 | |
IonSystems | 6:e64796f1f384 | 9 | void readChipNumbers(){ |
IonSystems | 6:e64796f1f384 | 10 | redAmount = readFile(0); |
IonSystems | 6:e64796f1f384 | 11 | greenAmount = readFile(1); |
IonSystems | 6:e64796f1f384 | 12 | blueAmount = readFile(2); |
IonSystems | 23:f9e7e64784be | 13 | recycleAmount = readFile(3); |
IonSystems | 6:e64796f1f384 | 14 | } |
IonSystems | 6:e64796f1f384 | 15 | |
IonSystems | 6:e64796f1f384 | 16 | void decrementRed(){ |
IonSystems | 6:e64796f1f384 | 17 | redAmount--; |
IonSystems | 6:e64796f1f384 | 18 | } |
IonSystems | 6:e64796f1f384 | 19 | void decrementGreen(){ |
IonSystems | 6:e64796f1f384 | 20 | greenAmount--; |
IonSystems | 6:e64796f1f384 | 21 | } |
IonSystems | 6:e64796f1f384 | 22 | void decrementBlue(){ |
IonSystems | 6:e64796f1f384 | 23 | blueAmount--; |
IonSystems | 6:e64796f1f384 | 24 | } |
IonSystems | 6:e64796f1f384 | 25 | |
IonSystems | 6:e64796f1f384 | 26 | void incrementRed(){ |
IonSystems | 6:e64796f1f384 | 27 | redAmount++; |
IonSystems | 6:e64796f1f384 | 28 | } |
IonSystems | 6:e64796f1f384 | 29 | void incrementGreen(){ |
IonSystems | 6:e64796f1f384 | 30 | greenAmount++; |
IonSystems | 6:e64796f1f384 | 31 | } |
IonSystems | 6:e64796f1f384 | 32 | void incrementBlue(){ |
IonSystems | 6:e64796f1f384 | 33 | blueAmount++; |
IonSystems | 6:e64796f1f384 | 34 | } |