Switch cases and ultrasonic sensor

Pleas post the code, IDE autoformatted and using code tags.
Poetry is not enough.