Code for using Ping as 0 1 High Low: Ultrasonic BS2
SpazmSi
Posts: 2
We are firing a ping pong ball through a series of vertical targets. I want to use the PING sensor as a simple 0 or 1, high or low edge finder. The idea being to rotate our bot until the edge of our target is found, then continue until the single is lost, thus finding the beginning of the hole cut in out target. I am really just hoping to find a basic code sample that I can begin to modify. We are not using any type of roaming function and the sensor if not mounted on the servo turret.
Thanks
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Code to calibrate:
Code to execute when you get a reading:
I used arrays since I have eight sensors that I want to get the input of (from an ADC). You would only need single variables. BTW, the code is for a line following robot.
Post Edited (SRLM) : 11/22/2009 10:37:24 PM GMT
http://forums.parallax.com/showthread.php?p=590119
-Phil