Go Down

### Topic: Output question (loop/erase) (Read 368 times)previous topic - next topic

#### Dual1ty

##### Apr 08, 2013, 10:27 am
Hi guys,
I don't know how to put my question into one sentence, so I am just going to describe it. It may sound dumb, but here:
I have ten outputs per second, e.g.
6
77
4
5
2
but once I start to get two digits:
12
72
52
42
the 12 goes back to 7, then to 5, then 4. The 2 stays there and does not go away until another two digit number comes.

How do I loop/erase the second digit for every output?
Might be a very simple answer but I don't know how to do it.

Thanks!

#### AWOL

#1
##### Apr 08, 2013, 10:43 am
Print a space if the value you're about to print is less than 10.
Or always print a trailing space.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

#### PaulS

#2
##### Apr 08, 2013, 11:46 am
Quote
I have ten outputs per second

Outputs to what?

Quote
How do I loop/erase the second digit for every output?

Erase it from what?

Sure be nice to know what you are talking about. Though I agree with AWOL as to the solution.

#### Dual1ty

#3
##### Apr 08, 2013, 10:50 pm
Sorry, it was in the middle of the night when I wrote this.
It outputs ten numbers per second to the LCD.
I want the program to erase every output from the LCD.
AWOL gave me a good solution,
lcd.print(sum + "  ");
but it does not work correctly and gives me letters/strings.

#### AWOL

#4
##### Apr 08, 2013, 10:54 pm
I certainly did not give you that solution.
Code: [Select]
`if (x < 10) {  Serial.print (" ");}Serial.print (x);` is pretty much what I wrote.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up

Please enter a valid email to subscribe