View unanswered posts | View active topics It is currently Sat Dec 27, 2014 10:11 am






Reply to topic  [ 3 posts ] 
Servo Rotation Programming 
Author Message
Rookie

Joined: Tue Oct 12, 2010 11:40 am
Posts: 2
Post Servo Rotation Programming
Hi my name is Evan Rogers, I am apart of the Marble Falls BEST Robotic Team. I have a question concerning the rotation of the Servo. So far the Servo goes at a rotation of about 120, but we want the Servo to rotate a full 180. How do we do that or what is the Programming that we need in order to make the Servo Rotate a full 180?


Fri Oct 22, 2010 11:12 am
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Servo Rotation Programming
The servo can go 120 in either direction. It's natural position is 0, which is exactly in the center. so when you give your servo a power of 50, it will go 50 to the right and stay there. When you give it -50, it will go 50 to the left and stay there. You have to start off at -60 and then turn to +120 if you want a 180 degree turn angle.

_________________
sudo rm -rf /


Sat Oct 23, 2010 6:34 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1376
Post Re: Servo Rotation Programming
I am new to programming servo in RobotC too, but I read the RobotC function library help and it said the servo array takes a value between 0 and 255. So I tried it out. I coded the following:
Code:
while (true)
{
    servo[servoArm] = 0;
    wait1Msec(2000);
    servo[servoArm] = 128
    wait1Msec(2000);
    servo[servoArm] = 255;
    wait1Msec(2000);
}

This code basically set the servo to 0-degree, 90-degree and then 180-degree and paused 2 seconds in between. It worked as expected.


Mon Nov 01, 2010 3:32 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.