Electronworks
New Member
I am using the HI Tech C compiler with MPLAB. I am trying to write a character string to a 16 digit LCD display. I want to set up an array of 16 characters then write different messages to it throughout the program (warning messages, status info etc)
The string will obviously be a maximum of 16 characters, so I have set up an array of 16 digits using the following:
I have also tried
I then try and fill it using
I have also tried using pointers to do the same thing, all without success. I get a variety of compiler errors.
What am I doing wrong? I have also read some of the LCD tutorials on this site, but they either load in individual characters (I want to load the whole string), or use the sprintf() function which is not documented in any of the code books I have. There must be a simpler way.
Please let me know
Thanks
The string will obviously be a maximum of 16 characters, so I have set up an array of 16 digits using the following:
Code:
unsigned char lcd_row[] = " ";
I have also tried
Code:
unsigned char lcd_row[16];
I then try and fill it using
Code:
lcd_row[] = "Hello World";
I have also tried using pointers to do the same thing, all without success. I get a variety of compiler errors.
What am I doing wrong? I have also read some of the LCD tutorials on this site, but they either load in individual characters (I want to load the whole string), or use the sprintf() function which is not documented in any of the code books I have. There must be a simpler way.
Please let me know
Thanks