اطلاعیه

Collapse
No announcement yet.

راه اندازی LCD کارکتری 2*16

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    راه اندازی LCD کارکتری 2*16

    راه اندازی LCD کارکتری 2*16

    فایل های برنامه : 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);
    	}

    #2
    پاسخ : راه اندازی LCD کارکتری 2*16

    دوستان در رابطه با توضیحات نحوه اتصال پین های LCD یک اشتباه رخ داده ، نحوه اتصال پین ها به ترتیب زیر هست :

    /*
    port for the LCD lines :PORTB
    pin for RS : PB4
    pin for RW : PB5
    pin for Enable :PB6
    pin for DB4 : PB0
    pin for DB5 : PB1
    pin for DB6 : PB2
    pin for DB7 : PB3
    */

    دیدگاه

    لطفا صبر کنید...
    X