lcd char display
Sneha kapoor this code is used to display B, S , R char on the LCD ...
U can try this code ..hope u wil get it...
// Write a Program to send letters B, S and R to the LCD using Delays
#include <reg51.h>
sfr ldata=0x90 //P1=LCD data pins
sbit rs=P2^0;
sbit rw=P2^1;
sbit en=P2^2;
void main()
{
lcd_cmd(0x38); //8/4 bit data and 5x8 character font
MsDelay(250);
lcd_cmd(0x0E); //Display ON , Cursor Blinking
MsDelay(250);
lcd_cmd(0x01); //Clear Display Screen
MsDelay(250);
lcd_cmd(0x06); // Increment Cursor(Shift cursor to Right)
MsDelay(250);
lcd_cmd(0x86); // Line 1, Position 6
MsDelay(250);
lcd_data('B');
MsDelay(250);
lcd_data('S');
MsDelay(250);
lcd_data('R');
MsDelay(250);
}
void lcd_cmd(unsigned char value)
{
ldata=value; // PUt the value on the pin
rs=0; // Command mode
rw=0; // Write to LCD
en=1;
MsDelay(1); //Delay
en=0;
return;
}
void lcd_data(unsigned char value)
{
ldata=value;
rs=1; // Data mode
rw=0;
en=1;
MsDelay(1):
en=0;
return;
}
void MsDelay(unsigned int time)
{
usigned int i, j;
for(i=0;i<time;i++)
for(j=0;j<1275;j++);
}
SRINU
Hyderabad