PIC16F-11-LCD-with-a-PIC-main.c

by Marwen Maghrebi
int main() {
    // Set pins as output
    ENABLE_DIRECTION    = 0;
    RS_DIRECTION        = 0;
    LCD_BUS_DIRECTION   = 0;

    // Write zero to pins and port
    ENABLE_LCD  = 0;
    RS_LCD      = 0;
    LCD_BUS     = 0;

    __delay_ms(10);          // 10 milliseconds delay

    // Initialization commands for LCD
    sendCommandToLCD(0x38); // Function set as given in datasheet
    sendCommandToLCD(0x0F); // Display ON; Cursor ON; Blink ON
    sendCommandToLCD(0x06); // Display shifting OFF
    sendCommandToLCD(0x01); // Clear screen command

    while(1) {
        clearLCD();
        __delay_ms(100);

        moveCursorToPosition(Line0);
        printToLCD("  THE EMBEDDED  ");

        moveCursorToPosition(Line1);
        printToLCD("     THINGS     ");
        __delay_ms(2000);           // 2 Second Delay.
    }
    return 0;           
}
Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?
-
00:00
00:00
Update Required Flash plugin
-
00:00
00:00