Using 4 Pin Ultrasonic Sensor with Shield-Bot and IR detection.
I ordered a 4 pin ultrasonic sensor to add to my shield-bot which is currently set up as the IR detection obstacle avoidance. I am just going to stick it on the breadboard facing straight out. Right now the robot gets stuck "jittering" in corners sometimes. I thought I could use the the ultrasonic detector to tell it do do a 90 degree turn or so before it gets too close to "jitter". Anybody else have a sketch that does something like this? Then I would like to add sounds to trigger when the ultrasonic is triggered. I'm new to arduino and have just been mostly playing around with the numbers in the sketch to change the speed and timing of the turns.
Comments
Are you using a Sharp IR distance sensor or the stock pair of IR LEDs & 38 kHz receivers?
http://learn.parallax.com/project/shield-bot-roaming-ping
Good call, Steph. As one might assume, the main difference between a 3-pin PING and a 4-pin HC-SR04 is... one pin. Most any program/sketch could be modified to use either sensor by changing a pin number or two. The cheap sensor has seperate lines for trigger and echo, where a PING combines them into a single pin.