View Single Post
  #1   Spotlight this post!  
Unread 13-01-2013, 21:50
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Printing over other text

Hello! I'm having a small bit of trouble. Nothing critical, but I was wondering if someone could quickly clear something up for me. How do I print text (to the driver station) which completely replaces the previous line? Here is my code:
Code:
                        if (joyTrigger)
			{
				dsLCD->Printf(DriverStationLCD::kUser_Line1, 1, "Trigger");
				dsLCD->UpdateLCD();
				Wait(0.1);
			}
			else if (Button2)
			{
				dsLCD->Printf(DriverStationLCD::kUser_Line1, 11, "BottomThumbButton");
				dsLCD->UpdateLCD();
				Wait(0.1);
			}
What it outputs is the current button (on the joystick). When I press a different button, it overwrites only the space it needs, so if I had it print something like "1111111111" and then something like "22222", it would end up printing "2222211111". I'm pretty sure it's just taking over the spaces, and not pushing the old text to the end of the line where it disappears. I know I could fix it by adding a bunch of spaces after each print, but is there another way? Thanks!
Reply With Quote