TextLCD library for controlling various LCD panels based on the HD44780 4-bit interface

Dependents:   04LCD_Hello_Word gestionenergie

Fork of TextLCD by Simon Ford

LCD.cpp

Committer:
Eduvance
Date:
2014-05-27
Revision:
9:befde34054fb
Parent:
TextLCD.cpp@ 7:44f34c09bd37

File content as of revision 9:befde34054fb:

#include "LCD.h"
DigitalOut RS(p25);
DigitalOut E(p24);
BusOut data(p23,p22,p21,p20);
void toggle_enable(void){
E=1;
wait(0.001);
E=0;
wait(0.001);
}
void LCD_init(void){
wait(0.02);
RS=0;
E=0;
data=0x2;
toggle_enable();
data=0x8;
toggle_enable();
data=0x0;
toggle_enable();
data=0xF;
toggle_enable();
data=0x0;
toggle_enable();
data=0x1;
toggle_enable();
}
void display_to_LCD(char value){
RS=1;
data=value>>4;
toggle_enable();
data=value;
toggle_enable();
}