Thomas Morris / Mbed OS PROJ324_Final

Fork of ELEC351_Group_T by Plymouth ELEC351 Group T

Revision:
52:99915f5240b2
Parent:
51:47f5db68500b
--- a/LCD.hpp	Tue Jan 09 15:15:08 2018 +0000
+++ b/LCD.hpp	Tue Jan 09 22:27:49 2018 +0000
@@ -4,46 +4,44 @@
 Then calling functions to display to information to the LCD
 */
 
-
+#ifndef LCD_HPP//Header Guards Prevents Multiple includes
+#define LCD_HPP
 
-#ifndef _LCD_HPP_ //Known as header guards
-#define _LCD_HPP_
-
-#include <string>
+//Libraries and header includes
+#include <string>   
 #include "mbed.h"
 #include "rtos.h"
-#
-class LCD //This creates a class called Led
-{
-    
+
+class LCD                                   //Declaration of LCD Class
+{ 
 public: 
  
-    LCD(PinName E, PinName RS, PinName RW, PinName DB0, PinName DB1, PinName DB2, PinName DB3, PinName DB4, PinName DB5, PinName DB6, PinName DB7);//Constructor
-    ~LCD();                                                                                                                                        //Destructor
-    void clock_in();                                                                                                                               //Waits for 
-    void Function_Set();
-    void Display_Off();
-    void Display_Clear();
-    void Entry_Mode_Set();
-    void Display_On();
-    void DDRAM_Address(int Address);
-    void Write_String(string Word);
-    void Initialise();
+    LCD(PinName E, PinName RS, PinName RW, PinName DB0, PinName DB1, PinName DB2, PinName DB3, PinName DB4, PinName DB5, PinName DB6, PinName DB7);     //Constructor
+    ~LCD();                                 //Destructor
+    void clock_in();                        //Clocks data into the LCD microcontroller
+    void Function_Set();                    //Sets display to use two lines
+    void Display_Off();                     //Turns the display off
+    void Display_Clear();                   //Clears the display
+    void Entry_Mode_Set();                  //Sets the cursor to move left to right with a non-shifting display
+    void Display_On();                      //Turns the display on
+    void DDRAM_Address(int Address);        //Sets the address to begin writing from
+    void Write_String(string Word);         //Sends a string to be written on the LCD
+    void Initialise();                      //Initialises the LCD
     
 private:    
     //Private member variables to prevent them being accessed externally 
-    DigitalOut _E;
-    DigitalOut _RS;
-    DigitalOut _RW;
+    DigitalOut _E;          //Enable Pin
+    DigitalOut _RS;         //Receive Send Pin
+    DigitalOut _RW;         //Read Write Pin
     //Data Pins
-    DigitalOut _DB0;
-    DigitalOut _DB1;
-    DigitalOut _DB2;
-    DigitalOut _DB3;
-    DigitalOut _DB4;
-    DigitalOut _DB5;
-    DigitalOut _DB6;
-    DigitalOut _DB7;
+    DigitalOut _DB0;        //Data Line 0
+    DigitalOut _DB1;        //Data Line 1
+    DigitalOut _DB2;        //Data Line 2
+    DigitalOut _DB3;        //Data Line 3
+    DigitalOut _DB4;        //Data Line 4
+    DigitalOut _DB5;        //Data Line 5
+    DigitalOut _DB6;        //Data Line 6
+    DigitalOut _DB7;        //Data Line 7
 };