Hi. Below is a code to write characters to a LCD display. I would like to know what does the * mean. Thx
void lcd_string(byte line,byte *_data_buffer)
{
byte i;
__RESET_WATCHDOG();
if(line==1)
{
lcd_write_cmd(0x40); //DDRAM
Check_LCD_Busy();//
lcd_write_cmd(0x80); //CGRAM
Check_LCD_Busy();
}
else
{
//lcd_write_cmd(0); //DDRAM
lcd_write_cmd(60); //DDRAM
Check_LCD_Busy();//
lcd_write_cmd(0xc0); //CGRAM
Check_LCD_Busy();//while((lcd_read_cmd()&0x80)==0x80);
}
for(i=0;i<LCD_16X2;i++)
{
if(_data_buffer[i]!=0)
{
lcd_write_data(_data_buffer[i]);
Check_LCD_Busy();
} else break;
}
}
Solved! Go to Solution.
Hello,
The following is an example of using the function -
const byte str1[] = "The quick brown fox";
const byte str2[] = ...
...
void main(void)
{
...
lcd_string(1, str1);
The value of str1 is a pointer to the first element (character) of the array str1[].
Regards,
Mac
Thx for the reply. So i think the program above means writing a character to the first space of the LCD, and then points to the next space and repeats the process.
Hi
I think byte *_data_buffer defines a pointer wich has the range of a byte. * mean that the follow variable is define or use (for use it must be define befor) as a pointer.
Example:
char *test defines a pointer test with a rang from 0 to 255.
Hello,
The following is an example of using the function -
const byte str1[] = "The quick brown fox";
const byte str2[] = ...
...
void main(void)
{
...
lcd_string(1, str1);
The value of str1 is a pointer to the first element (character) of the array str1[].
Regards,
Mac