We have several kits with distance sensors and they all are having this issue:
The distance sensor displays correct values when run directly from the brain via Settings→Device Info→[port] (and reports “No object beyond” 19 inches) but when run from a program in VEXcode IQ Blocks, it fails beyond about 9 inches and displays “1” (1 inch).
Printing / clearing too quickly. The wait block allows time for the text to be drawn on the screen (and read by the user). Typically a 1/10th of a second is more than enough of a delay when printing on the screen.
The “4294967295” is a maximum unsigned 32-bit integer. This is because the sensor reports “-1” when an object isn’t detected. We felt that -1 wasn’t help since a lot of times logic is checking “distance sensor < X”, so instead the value was made positive. I’m not sure (2^32)-1 is the best choice, but it’s better than -1… but that’s a separate discussion.
Nice choice over -1. Now if you promise that the infinity distance will be “4294967295” we can use that as the upper bound. I most likely would have gone with 9999. But then Future Foster will come back to yell at me to say “Hey the 2045 GDC made the field be 300 yards long.”