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:
18:12e2c82a5a6c
Parent:
6:e64796f1f384
Child:
23:f9e7e64784be
--- a/mbedLCD.h	Mon Nov 24 14:00:46 2014 +0000
+++ b/mbedLCD.h	Mon Nov 24 16:09:52 2014 +0000
@@ -34,6 +34,30 @@
       
 }
 
+void printLCD(string txt_str){
+        lcd->reset();
+        if(txt_str.length() > 32){
+            int length = txt_str.length();
+            txt_str = txt_str.erase(32,length-32);
+            lcd->locate(0,0);   //Going to new line
+            
+        }
+            if(txt_str.length() > 16){
+            string line1 = txt_str.substr(0,16);
+            string line2 = txt_str.substr(16,16);
+            lcd->locate(0,0);   //Going to new line
+            lcd->printf(line1.c_str());
+            lcd->locate(1,0);   //Going to new line
+            lcd->printf(line2.c_str());
+            lcd->locate(0,0);   //Going to new line
+            }
+            if(txt_str.length() <= 16){
+                lcd->locate(0,0);
+                lcd->printf(&txt_str[0]);
+            }
+      
+}
+
 void setupLCD(){
     par_port = new MCP23017(p9, p10, 0x40);
     par_port->config(0x0F00, 0x0F00, 0x0F00); // configure MCP23017 chip on WattBob