Pages: [1]   Go Down
Author Topic: Need help with controlling servo with Sharp distance sensor.  (Read 303 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 436
Posts: 23632
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try reading  here to start, see how things are done.
http://forum.arduino.cc/index.php?topic=185476.0
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Idaho, US
Offline Offline
God Member
*****
Karma: 19
Posts: 859
Special User
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: