/************************************************************************************* * * Function: PrintLcdText * * Description: Print text in *text onto LCD display * * Parameters: *text: points to array of chars to print on LCD * * Return: void * *************************************************************************************/ void PrintLcdText(char *text) { HC_PRINT("Printing following text to LCD:\n"); HC_PRINT(text); HC_PRINT("\n"); /* Connect to the LCD display on the I2C bus and register a file descriptor handle */ fd = ConnectI2CSlave(LCD_FILE_DESCRIPTOR, LCD_I2C_ADDRESS); /* Setup the LCD */ InitializeLCD(); /* Move cursor to first line 0th position */ SetCursor(0, 0); /* Print some text on the LCD */ PrintText(text, strlen(text)-1); }
int main(void) { int i; // Initialize all components InitializeGPIOPorts(); InitializeTimer0AForDelay(); InitializeLCD(); SendCommand(0xCUL); // Turn off cursor InitializeSpecialCharacters(); // Shift the screen to the right by 16 times so that the end of the screen will have the address 0x80 for (i=0; i<16; i++) { SendCommand(0x1C); } InitializeTimer0BForScroll(); InitializeNVIC(); TIMER0->CTL |= (0x1UL<<8); // Enable timer B interrupt while (1) { } } // End main().