راه اندازی LCD کارکتری 2*16
فایل های برنامه : TATLI_AVR2
توضیحات رو بصورت کامند ارائه کردم ، نحوه اتصال پایه های LCD هم که مشخص شده
برنامه :
فایل های برنامه : TATLI_AVR2
توضیحات رو بصورت کامند ارائه کردم ، نحوه اتصال پایه های LCD هم که مشخص شده
برنامه :
کد:
#include <avr/io.h>
#include <util/delay.h>
#include <avr/pgmspace.h>
#include "lcd.h"
/*
port for the LCD lines :PORTB
pin for RS : PB4
pin for RW : PB5
pin for Enable :PB6
pin for DB4 : PB0
pin for DB3 : PB1
pin for DB2 : PB2
pin for DB1 : PB3
*/
void main(void)
{
char buffer[16],i=16;
lcd_init(LCD_DISP_ON); // Alphanumeric LCD initialization
lcd_clrscr(); //Clear display and set cursor to home position
lcd_gotoxy(16, 0); //Set cursor to specified position
lcd_puts("TATLI AVR IS THE BEST"); //Display character at current cursor position
while(--i>-23)
{
_delay_ms(500);
lcd_command(LCD_MOVE_DISP_RIGHT); //shift display right
}
lcd_clrscr(); //Clear display and set cursor to home position
lcd_gotoxy(0,0); //Set cursor to specified position
lcd_puts("by : mojtaba_led");
while(1);
}


دیدگاه