Lag(?) issues

Your robot will be flying blind while this code executes. A timeout on the pulseIn call would be a good thing.

What do you mean by a time out? like another delay or something? This was based on: http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor.

If I understand the functionality of the device (and the code), the sensor is activated with a 5 us digital high pulse and then the sensor reading is sent back on the same pin as a timed input digital high pulse, the time of which corresponds to the distance. Or is the the pulseIn() command measuring the digital low time until the digital high input comes? I don't think that's the case though. Should I put in like a 2-5 us delay before the sensorRead = pulseIn() part? I have no idea how much time there is between the end of the initiation output digital high pulse and the beginning of the reading input digital high pulse. Using the code fromt he ling and just the sensor, that did work. I notice there is an error in my sensor switch structure where there is supposed to be a 100 ms delay between each sensing that isn't happening that i found when I was relabeling all of my cases to repost that code (which I will do shortly after testing to see if i still have problems).