Liam Grazier
/
Final351CWfolderonly
Fork of Final351CW_FINAL by
Diff: LGLCD/lglcd.h
- Revision:
- 11:ce2a977dcab0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LGLCD/lglcd.h Tue Jan 09 11:59:10 2018 +0000 @@ -0,0 +1,35 @@ +/* ELEC351 COURSEWORK 2018 +DESIGNED USING MBED ONLINE COMPILER IMPORTED TO KEIL +LIAM GRAZIER // DOUG TILLEY // ALEX BARON + */ +#ifndef __LGLCD_H +#define __LGLCD_H +#define CMD 0 //adapted from 2nd year code +#define TXT 1 +#define CLEAR 1 +#define HOME 2 +#define READ 1 +#define WRITE 0 +#define LEFT 0 +#define RIGHT 1 +#define LINE1 0x80 // Start address of first line +#define LINE2 0xC0 // Start address of second line +#define LCD_CLR (writedata(CLEAR,CMD)) +#define LCD_HOME (writedata(HOME,CMD)) +#define LCD_BUSYBIT 0x8000 //correct value for the lcd BUSYBIT +//mylcdclass +class lglcd +{ +public: +lglcd(PinName RS, PinName E, PinName D4, PinName D5,PinName D6, PinName D7); //statement for pin enables +void clear(void); //function for clearlcd +void writedata(unsigned char info, unsigned char type); //function forwiring data on the screen +void lglcd::setline(int row,int column); //setline command row/column +void write(char charq[]); //wirint char/str on mylcd. +int l; +protected: +BusOut _lcdinfo; //output define for D4-D7 +DigitalOut _lcdrs; //output define for RS Pin +DigitalOut _lcde; //output define for E pin +}; +#endif \ No newline at end of file