Professional Documents
Culture Documents
LCD
LCD
h>
//LCD
sfr LCDdata=0xA0;
sbit LCDrs=P1^0;
sbit LCDen=P1^2;
//
LCDen=1;
LCDdata=DATA;
LCDrs=1;
LCDen=0;
}
// Easy function to print data and strings to LCD
void display_lcd (unsigned char location, unsigned char *d)
{
lcdcmd(0x80 | location);
#include<reg51.h>
//LCD
sfr LCDdata=0xA0;
sbit LCDrs=P1^0;
sbit LCDen=P1^2;
//
LCDen=1;
LCDdata=DATA;
LCDrs=1;
LCDen=0;
}
// Easy function to print data and strings to LCD
void display_lcd (unsigned char location, unsigned char *d)
{
lcdcmd(0x80 | location);
#include<reg51.h>
//LCD
sfr LCDdata=0xA0;
sbit LCDrs=P1^0;
sbit LCDen=P1^2;
lcdcmd (0x0c);
delay(30);
lcdcmd (0x01);
delay(30);
lcdcmd (0x06);
delay(30);
}
// Sets LCD in command data and passes data
void lcddat (unsigned int DATA)
{
LCDrs=1;
//
LCDen=1;
LCDdata=DATA;
LCDrs=1;
LCDen=0;
}
// Easy function to print data and strings to LCD
void display_lcd (unsigned char location, unsigned char *d)
{
lcdcmd(0x80 | location);
#include<reg51.h>
//LCD
sfr LCDdata=0xA0;
sbit LCDrs=P1^0;
sbit LCDen=P1^2;
}
}
// Initialization of LCD
void initialize (void)
{
lcdcmd (0x30);
delay(30);
lcdcmd (0x38);
delay(30);
lcdcmd (0x0c);
delay(30);
lcdcmd (0x01);
delay(30);
lcdcmd (0x06);
delay(30);
}
// Sets LCD in command data and passes data
void lcddat (unsigned int DATA)
{
LCDrs=1;
//
LCDen=1;
LCDdata=DATA;
LCDrs=1;
LCDen=0;
}
// Easy function to print data and strings to LCD
void display_lcd (unsigned char location, unsigned char *d)
{
lcdcmd(0x80 | location);
#include<reg51.h>
//LCD
sfr LCDdata=0xA0;
sbit LCDrs=P1^0;
sbit LCDen=P1^2;
//
LCDen=1;
LCDdata=DATA;
LCDrs=1;
LCDen=0;
}
// Easy function to print data and strings to LCD
void display_lcd (unsigned char location, unsigned char *d)
{
lcdcmd(0x80 | location);