LPU,NH-1 GT road, Jalandhar rohit.hero12@gmail.com +91-8437503569 https://www.facebook.com/rohit.adhikary3

P-Programming T-Technology A-And TI-Tips C-Cracking

Monday, 20 April 2015

Display 'A' in LCD

Hello Reader,
In this page,i am writting about the  program which is going to display in LCD any letter.
#include<util/delay.h> //delay time
#include<avr/io.h>   // atmega 16 input/output
#define RS 0
#define EN 1 //enable
void lcd_command(unsigned char x)
{PORTB=x;  //port B
PORTC=0;  //port C
PORTC|=(1<<EN);
_delay_ms(1);
PORTC&=~(1<<EN);
_delay_ms(100);
}
void lcd_data(unsigned char x)
{PORTB=x;
PORTC=(1<<RS);
PORTC|=(1<<EN);
_delay_ms(1);
PORTC&=~(1<<EN);
_delay_ms(100);
} void lcd_ini()
{
lcd_command(0x38); //command that going to display in LCD
lcd_command(0x01);
lcd_command(0x0E);
lcd_command(0xC4);
}

int main()
{
DDRB=0XFF; // port B
DDRC=0XFF;  //port C
lcd_ini();
lcd_data('A');    // display 'A' in LCD

}

0 comments:

Post a Comment

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered by Blogger.