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:
Sat Nov 29 16:32:57 2014 +0000
Revision:
23:f9e7e64784be
Parent:
13:0661d658d9d1
Child:
24:8868101d01d0
might be working

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IonSystems 6:e64796f1f384 1 #include "mbed.h"
IonSystems 6:e64796f1f384 2 DigitalIn cardBit1(p21);
IonSystems 6:e64796f1f384 3 DigitalIn cardBit2(p22);
IonSystems 6:e64796f1f384 4 DigitalIn cardBit3(p23);
IonSystems 6:e64796f1f384 5 DigitalIn cardBit4(p24);
IonSystems 6:e64796f1f384 6 DigitalIn cardBit5(p25);
IonSystems 6:e64796f1f384 7 DigitalIn cardBit6(p26);
IonSystems 6:e64796f1f384 8 DigitalIn cardDetect(p29);
IonSystems 6:e64796f1f384 9
IonSystems 23:f9e7e64784be 10 bool cardValues[6] = {0,0,0,0,0,0};
IonSystems 6:e64796f1f384 11
IonSystems 10:8c0696b99692 12 bool cardDataAcquired = false;
IonSystems 10:8c0696b99692 13
IonSystems 23:f9e7e64784be 14 int cardAcquisition(){
IonSystems 23:f9e7e64784be 15 //Work out the number of the card
IonSystems 23:f9e7e64784be 16 int cardNumber = 0;
IonSystems 23:f9e7e64784be 17 //Bit 1
IonSystems 23:f9e7e64784be 18 if(cardBit1) cardNumber += 1;
IonSystems 23:f9e7e64784be 19 if(cardBit2) cardNumber += 2;
IonSystems 23:f9e7e64784be 20 if(cardBit3) cardNumber += 4;
IonSystems 23:f9e7e64784be 21 if(cardBit4) cardNumber += 8;
IonSystems 23:f9e7e64784be 22 if(cardBit5) cardNumber += 16;
IonSystems 23:f9e7e64784be 23 if(cardBit6) cardNumber += 32;
IonSystems 6:e64796f1f384 24
IonSystems 23:f9e7e64784be 25 return cardNumber;
IonSystems 6:e64796f1f384 26
IonSystems 6:e64796f1f384 27
IonSystems 6:e64796f1f384 28
IonSystems 6:e64796f1f384 29
IonSystems 6:e64796f1f384 30
IonSystems 6:e64796f1f384 31 }