Go Down

Topic: Need help with controlling servo with Sharp distance sensor. (Read 418 times) previous topic - next topic

Here, I have arduino uno, micro servo, and a distance sensor. I connect the servo on pin 9 and the sensor on analog pin 0 (A0). I want to rotate the servo to 90 degrees when the distance sensor detecting. and if it does not detect the remains in a position of 0 degrees. how about source code ? please help me.

CrossRoads

Try reading  here to start, see how things are done.
http://forum.arduino.cc/index.php?topic=185476.0
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

I've tried the code. Servo keep rotate but sensor not detect'. :\

tylernt


I've tried the code. Servo keep rotate but sensor not detect'. :\
If you post your code here on this forum, perhaps we can help.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy