Continuing the discussion from Jittery Ultrasonic Sensor Output:
We ran into a similar problem while running interactively in scratch. Both the line follower and the ultrasonic sensors would regularly report zeros when they were clearly seeing other readings. The line follower was indicating that it saw reflections with one or more of the sensors as indicated by the lights yet the sensor would report zeros interactively. Diagnostic routines to simply pole and print the sensor readings would almost always report zeros. If we downloaded related programs to the arduino and ran them locally, they worked fine (obviously we could not print). This was especially frustrating because we had a group of 28 kids trying to program mbots and run them interactively in mBlock. The programs only ran when downloaded to the arduinos otherwise they were fickle. This occurred with macs and pcs, with bluetooth and 2.4G communication. In the end, the kids still had fun, but we were not able to tackle more difficult programs given the issues we were having. We would love to continue using the mbots for the kids at our school, but need to get past this issue.
Kind Regards