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:
Fri Nov 07 20:16:23 2014 +0000
Revision:
6:e64796f1f384
Child:
8:b7771391adc9
Recovered from the attack of Euan

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IonSystems 6:e64796f1f384 1 #include "mbed.h"
IonSystems 6:e64796f1f384 2
IonSystems 6:e64796f1f384 3 //Setup pins to FPGA
IonSystems 6:e64796f1f384 4 DigitalOut startSort(p5); //A positive edge tells the FPGA to start sorting.
IonSystems 6:e64796f1f384 5
IonSystems 6:e64796f1f384 6 /*
IonSystems 6:e64796f1f384 7 The command codes for the three sort select bits(ColourBit1 - ColourBit2)
IonSystems 6:e64796f1f384 8 000 Sort red chip
IonSystems 6:e64796f1f384 9 001 Sort green chip
IonSystems 6:e64796f1f384 10 010 Sort blue chip
IonSystems 6:e64796f1f384 11 011 Bin the chip
IonSystems 6:e64796f1f384 12 100 Recycle the chip
IonSystems 6:e64796f1f384 13 101 Nothing
IonSystems 6:e64796f1f384 14 110 Nothing
IonSystems 6:e64796f1f384 15 111 Nothing
IonSystems 6:e64796f1f384 16 */
IonSystems 6:e64796f1f384 17
IonSystems 6:e64796f1f384 18 DigitalOut colourBit1(p6); //The 3 bits below are select bits for the sorter.
IonSystems 6:e64796f1f384 19 DigitalOut colourBit2(p7);
IonSystems 6:e64796f1f384 20 DigitalOut colourBit3(p8);
IonSystems 6:e64796f1f384 21 DigitalOut startDispense(p9); //A positive edge tells the FPGA to start dispensing.
IonSystems 6:e64796f1f384 22 /*
IonSystems 6:e64796f1f384 23 00 Dispense red chip
IonSystems 6:e64796f1f384 24 01 Dispense green chip
IonSystems 6:e64796f1f384 25 10 Dispense blue chip
IonSystems 6:e64796f1f384 26 11 Nothing
IonSystems 6:e64796f1f384 27 */
IonSystems 6:e64796f1f384 28
IonSystems 6:e64796f1f384 29 DigitalOut DispenseBit1(p10); //The 2 bits below are select bits for the dispenser.
IonSystems 6:e64796f1f384 30 DigitalOut DispenseBit2(p11);