liamgrazier lcd library 16x02
Fork of LGLCDv2 by
Diff: lglcd.h
- Revision:
- 2:d812a2a643bc
- Parent:
- 1:9020af47a312
--- a/lglcd.h Fri Jan 05 17:56:27 2018 +0000 +++ b/lglcd.h Tue Jan 09 11:32:39 2018 +0000 @@ -1,37 +1,35 @@ -#ifndef __LGLCD_H +/* 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 -#define TXT 1 -#define CLEAR 1 -#define HOME 2 -#define READ 1 +#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 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); -void clear(void); -void writedata(unsigned char info, unsigned char type); -void lglcd::setline(int row,int column); -void write(char charq[]); -int l; +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; -DigitalOut _lcdrs; -DigitalOut _lcde; -int cline; -int cpos; +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