Hi Sara, not sure why my answer was truncated.
Here is a image from my LCD display, there you can see strange characters after the word “OFF”
Hi again.
Can you show me the lines of code that display that message?
Regards,
Sara
Hi Sara,
Here is the code:-
Start your code here
// set cursor to first column, first row
lcd.setCursor(0, 0);
// print message
lcd.print(“State:- “);
lcd.println(messages[systemState]);
delay(1000);
// clears the display to print new message
lcd.clear();
// set cursor to first column, second row
lcd.setCursor(0,1);
lcd.print(“CurrWt:- “);
lcd.print(currentWeight);
Many thanks
Paul
Can you show me the definition of the messages variable?
Try creating an auxiliary String variable with the message you want to display, and then display that variable instead of “messages[systemState]”.
Regards,
Sara
Sara,
Thank you for your assistance. Here is the code:-
Start your code here
enum _state_enum
{
START,
FILLING,
EMPTYING,
STEEP1,
REST1,
STEEP2,
REST2,
STEEP3,
REST3,
OFF,
};
_state_enum systemState = START;
// convert State Enu into Char for Serial print
const char * messages[] = {
“START”,
“FILLING”,
“EMPTYING”,
“STEEP1”,
“REST1”,
“STEEP2”,
“REST2”,
“STEEP3”,
“REST3”,
“OFF”
};
Can you try it like this:
String messageToPrint = messages[systemState];
lcd.println(messageToPrint);
Instead of:
lcd.println(messages[systemState]);
I know this might seem the same thing, but sometimes this solves that kind of issue.
Regards,
Sara
It kinda looks like a problem I had when working with Microchip PIC and 2 x 16 displays. It turned out that the display buffer would still contain some artifacts. The fix at the time was to write the complete line with extra spaces if needed.