Mình viết code dịch chữ LCD dùng pic 16f877a nhưng sao nó chỉ dịch được 1 nửa đoạn kí tự. bạn nào có kinh nghiệm chỉ mình với!
Code:
#include <16f877a.h>
#device adc=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20m)
#define LCD_RS_PIN PIN_D0
#define LCD_ENABLE_PIN PIN_D1
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
#include <lcd_4bit.c>
int8 i;
void main()
{
while(1)
{
set_tris_d(0);
lcd_init();
delay_ms(10);
for(i=0;i<30;i++)
{
LCD_SetPosition(0x80);
printf(lcd_putchar,"DO AN 2: Dieu khien nhiet do ON/OFF dung PIC va hien thi LCD");
delay_ms(10);
LCD_PutCmd (0x1c) ;
}
}
}
Code:
#include <16f877a.h>
#device adc=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20m)
#define LCD_RS_PIN PIN_D0
#define LCD_ENABLE_PIN PIN_D1
#define LCD_DATA4 PIN_D4
#define LCD_DATA5 PIN_D5
#define LCD_DATA6 PIN_D6
#define LCD_DATA7 PIN_D7
#include <lcd_4bit.c>
int8 i;
void main()
{
while(1)
{
set_tris_d(0);
lcd_init();
delay_ms(10);
for(i=0;i<30;i++)
{
LCD_SetPosition(0x80);
printf(lcd_putchar,"DO AN 2: Dieu khien nhiet do ON/OFF dung PIC va hien thi LCD");
delay_ms(10);
LCD_PutCmd (0x1c) ;
}
}
}