alpha91
Full Member level 3
Hi all, I am learning the custom LCD character which interface withIC 16f628a interface.
My code is as below which i refer online. It works, but i am not understand some part of the code which i highlighted. Can anyone try to explain to me?
My code is as below which i refer online. It works, but i am not understand some part of the code which i highlighted. Can anyone try to explain to me?
// LCD module connections
sbit LCD_RS at RA0_bit; // sbit declares LCD_RS at RA_0 address
sbit LCD_EN at RA1_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISA0_bit;
sbit LCD_EN_Direction at TRISA1_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;
// End LCD module connections
#pragma config CP = ON
// End LCD module connections
void CustomChar1(char pos_row, char pos_char);
char message1[] = "I";
char message2[] = "Everyone";
void main() {
CMCON = 0x07;
while (1){
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CURSOR_OFF); // OFF cursor
Lcd_Cmd(0x01); // Clear display
Lcd_Cmd(0x03);
Lcd_out(1,1,message1);
Lcd_out(1,5,message2);
CustomChar1(1,3);
delay_ms (3000);
}
}
const char character[] = {0,27,31,31,14,4,0,0};
void CustomChar1(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);
}