kikic -3 Light Poster
//================= 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");
}

I want to display string="MYNAME" on LCD , I import the string on serial port, but it was not display on LCD. What is the error? Could someone help me? I use pic16f887 and pic simulator IDE. Is there some function or something else?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.