Ultra-Sonic Sensor and Servo Help

Hi everyone,
I was wondering if I could get some help. Basically I need a code that will allow me to have two ultrasonic sensors and two servos.

I need one of the sensors to control the first servo. I should be able to move my hand in front of it and the servo should move to a certain point.

The second sensor, on the other hand, has to control what angle the servo moves to. So if my hand was close it would be at a small angle, as my hand moves away, the angle of the servo should increase.

Thanks in advance.

Alex

This tutorial may helpful for you: Arduino - Ultrasonic Sensor Control Servo Motor

IoT_hobbyist:
This tutorial may helpful for you: Arduino - Ultrasonic Sensor Control Servo Motor

Thank you so much! You wouldn't happen to know where I could find a code where two ultra-sonic sensors can move the same servo?

Thanks again.

I do not know that code, but you can modify the code in that tutorial

hy

i am also working with multiple sensors and two servo's, my question to you is how did you wire the two ultrasonic sensors so that they would mesure distances at the same time? and do you use an external power source?

And yes if you're running 2 servos you need external power at least for them. DON'T try powering them from the Arduino.

Steve