Hello, i am working with 4x20 LCD and PIC microcontroller . Compiler - mikroC from mikroelektronika. I need to show several custom characters in LCD, in different rows and positions. Simplified structure of my code is:
In this case everything works fine. But if i change code to this:
compiler gives me errors. So i need to show different characters like:
So how simply and effective write the code?
Rich (BB code):
const char character[]={4,14,21,4,4,17,31,0};
void CustomChar(char pos_row, char pos_char)
{
char i;
Lcd_Cmd(64);
for (i = 0; i<=7; i++) Lcd_Chr_CP(character);
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
}
void Menu(){CustomChar(1,5);}
void main()
{
for(;;){Menu();}
}
Rich (BB code):
void CustomChar(char pos_row, char pos_char)
{
char i;
Lcd_Cmd(64);
for (i = 0; i<=7; i++) Lcd_Chr_CP(character);
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
}
void Menu()
{
const char character[]={4,14,21,4,4,17,31,0};
CustomChar(1,5);
}
void main()
{
for(;;){Menu();}
}
Rich (BB code):
void Menu()
{
const char character[]={4,14,21,4,4,17,31,0};
CustomChar(1,5);
const char character[]={0,0,0,0,0,17,31,0};
CustomChar(2,5);
.....
}