Ben Gordon / Mbed OS ELEC351_GroupA-branch1
Revision:
10:4f8b0c09bd2c
Parent:
9:f8c8f0b11893
Child:
12:edf31d0a61f0
--- a/LCD.cpp	Wed Nov 07 17:44:59 2018 +0000
+++ b/LCD.cpp	Wed Nov 07 23:58:03 2018 +0000
@@ -10,19 +10,19 @@
     //LCD Initialise
     wait_ms(45); //Wait for LCD startup
     /*Step 1*/
-        wait_us(3000);      //Wait whilst LCD busy
+        wait_us(40);      //Wait whilst LCD busy
         _LCD_RS = control;   
         LCD_DDRAM = 0;  //Clear data line
-        LCD_DDRAM = DDRAM>>4;  //Put data on line
+        LCD_DDRAM = (FUNC|bit8)>>4;  //Put data on line
         LCD_strobe();
     
-    /*Step 2*/ cmdLCD(DDRAM|lines2);  //Function Set 0x20|0x08 = 0x28
-    /*Step 3*/ cmdLCD(DDRAM|lines2);  //Function Set 0x20|0x08 = 0x28
+    /*Step 2*/ cmdLCD(FUNC|lines2);  //Function Set 0x20|0x08 = 0x28
+    /*Step 3*/ cmdLCD(FUNC|lines2);  //Function Set 0x20|0x08 = 0x28
     /*Step 4*/ cmdLCD(DISPLAY|on);    //Display Control 0x08|0x0x04 = 0x0c
     /*Step 5*/ cmdLCD(CLEAR);         //Clear Display 0x01
     /*Step 6*/ cmdLCD(ENTRYMODE|I);   //Set entry mode 0x04|0x02 = 0x06
 
-    cmdLCD(0x20); //return home location
+    cmdLCD(RETURN); //return home location
 }
 
 void LCD::clear()