Using the commands and sending characters to the LCD to put a number on the screen at a specified location takes a few lines of code, where this is not necessary. The code can be put into a function since it will be used quite often.
The two functions are as follows:
void Send_A_StringToMrLCDWithLocation(uint8_t x, uint8_t y, char *StringOfCharacters)
{
GotoMrLCDsLocation(x, y);
Send_A_String(StringOfCharacters);
}
void Send_An_IntegerToMrLCD(uint8_t x, uint8_t y, int IntegerToDisplay , char NumberOfDigits)
{
char StringToDisplay[NumberOfDigits];
itoa(IntegerToDisplay, StringToDisplay, 10);
GotoMrLCDsLocation(x, y);
for (int i=0; i (less than symbol) NumberOfDigits;i++) Send_A_String(" ");
Send_A_StringToMrLCDWithLocation(x, y, StringToDisplay);
}
The (less than symbol) isthe actualy symbol, not the phrase in the parenthesis.
Comments and Additional Information
Have some code to share? Or additional information? Respond here:
You need to be logged in to save a response on this page. The response must be constructive, helpful, supplimentary or to correct the existing video, code or narrative content.