Let's Make Robots!



I have built my first robot, everything works fine EXCEPT one thing: the ranging sensor. When I try the simple readadc 0,b0 / debug program, the value is nearly always 158-159 ocasionnaly flashing to another value. Any help with this?

Many thanks.

PS: I am using the Picaxe Programming Editor and a Sharp GP2Y0A02YK0F

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Thank you all for your help. Would you happen to know where I can find the correct cable? Or do I have to "make" one myself? Thank you in advance.

The plastic "tongues" that hold the wires in place on the black connnector can be lifted carefully, and, the wires will slide out. Once you get the red and yellow wire out, just push them back in to the spots you need them to be in.

It worked. Thank you very much. Seems the sensor is not fried after all. However, although it can easily read "readadc 0, b0" it constantly displays the same number for "readadc 1, b1" and "readadc 2, b1". Any help with this?

readadc 0, b0 reads on analog pin 0 and stores the answer in byte 0. You probably don't have anything connected to the other pins, so, there won't be a useful response.