Go Down

Topic: Changing one character at Cursor wipes rest of the line (Read 28 times) previous topic - next topic

howcome

I am trying to develop a tool using the 2 line LCD display with 5 buttons.

I have defined a character with lcd.createChar, which I use as a switch indicator and have written a few procedures to toggle the state of a variable with the buttons.
The switch indicators are placed in fixed positions on the first row of the display using a standard lcd.write. Part of my code that deals with the button is like this:

void SwitchDl(){
  if (Dl == 0) {
     Dl = 1;
     lcd.setCursor(7,0);
     lcd.write(4);
     WriteBotLine("DLY ON ");
     DecodeSwitchOn("DLY");
  }
  else
  {
     Dl = 0;
     lcd.setCursor(7,0);
     lcd.write(1);
     WriteBotLine("DLY OFF");
     DecodeSwitchOff("DLY");

  }
}


I have a few consecutive switch indicators that I want to display, but the thing is that when i display a character on a specific position on one line, it wipes the entire rest of the line.
How can I make these chars 'stick' to their positions when I change one?

floresta

Quote
Part of my code ... is like this:
It is the rest of the code that is probably causing the problem.

Don

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy