I’ve built something similar to your WiFi car and intended to programme it for mindless autonomy i.e.
if close to something, turn until no longer
But the output of the sensor example code is erratic (whereas the ultrasonic sensor isn’t when connected to Lego’s own controller).
Just staring into space it returns values like this;
With my hand closer (stable position) I get much smaller values, but again jumping erratically;
Is the expected sensor output range 0(close) - 255(far)?
Is their any reason why the output would be so erratic? Could it be affected by power - following 9v battery power issues I’m powering the BrickPi from a jury rigged 8x 1.5v AA pack …