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

Revision:
24:8868101d01d0
Parent:
23:f9e7e64784be
--- a/cardReader.h	Sat Nov 29 16:32:57 2014 +0000
+++ b/cardReader.h	Wed Dec 03 17:49:41 2014 +0000
@@ -1,4 +1,5 @@
 #include "mbed.h"
+//  Define the card reader input pins.
 DigitalIn cardBit1(p21);
 DigitalIn cardBit2(p22);
 DigitalIn cardBit3(p23);
@@ -7,10 +8,11 @@
 DigitalIn cardBit6(p26);
 DigitalIn cardDetect(p29);
 
-bool cardValues[6] = {0,0,0,0,0,0};
-
-bool cardDataAcquired = false;
-
+/*  cardAcquisition()
+ *  Reads the binary values of the card reader inputs and converts them into a decimal number.
+ *  The decimal number is returned as an integer.
+ */
+ 
 int cardAcquisition(){
         //Work out the number of the card
         int cardNumber = 0;
@@ -22,10 +24,5 @@
         if(cardBit5) cardNumber += 16;
         if(cardBit6) cardNumber += 32;
         
-        return cardNumber;
-        
-        
-        
-        
-        
+        return cardNumber;  
     }
\ No newline at end of file