//================= konfigure LCD
// porta za podatoci e PORTB
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
char name;
char txt[16];
void init(){
PORTB = 0xFF;
TRISB = 0x00;
ANSEL = 0x00;
ANSELH = 0x00;
C1ON_bit = 0;
C2ON_bit = 0;
UART1_Init(9600);
Delay_ms(100);
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
}
//=========================================================
void main()
{
init();
UART1_Write_Text("Start");
UART1_Write(10);
UART1_Write(13);
do{
}
while(!UART1_Data_Ready());
name = UART1_Read();
if (name!='.')
{
strcpy(txt,"name");
strcat(txt,name);
Lcd_Out(1,1, txt);
Delay_ms(1);
}
else
Lcd_Out(2,1, "error");
}
Je souhaite afficher string="MYNAME"
sur l'écran LCD. J'importe la chaîne sur le port série, mais pas sur l'écran LCD. Quelle est l'erreur? Quelqu'un pourrait-il m'aider? J'utilise pic16f887 et PIC simulateur IDE. Y at-il une fonction ou quelque chose d'autre?chaîne d'importation par port série et impression sur l'écran LCD
s'il vous plaît aidez-moi, il est très important pour moi .... – buuuuu