Subject:
|
servo motors
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 2 Mar 2000 13:10:43 GMT
|
Original-From:
|
E158 (M.FAZAL) <m.fazal@bham-eee-fs4.!StopSpammers!bham.ac.uk>
|
Viewed:
|
932 times
|
| |
| |
hi all
i connected a servo to the digital 9 port, downloaded the servo.icb and
servo.c files. from the command line i can control the servo. but then i
wrote the following very simple code, and it doesnt work. can anyone spot
the problem.
void main()
{
servo_on(); /* on servo */
servo(3800); /* full left turn */
servo_off(); /* off servo */
fd(0); /* motor 0 on */
sleep(2.0); /* for 2 secs */
servo_on(); /* on servo */
servo(2500); /* mid position */
servo_off();
}
many thanks
m fazal
|
|
Message has 2 Replies: | | Re: servo motors
|
| (...) What is it supposed to be doing? When you say _it_ doesn't work, what exactly is not working? I'm not that familiar with the routines but it looks like you're shutting off the servos before they can move. I also believe once you turn off the (...) (25 years ago, 2-Mar-00, to lugnet.robotics.handyboard)
| | | Re: servo motors
|
| Hi, Try adding some delay time between turning the servo on and off. For example, 'sleep(2.0);'. Add the sleep(2.0) as follows: (...) sleep(2.0); /* wait for 2 seconds for servo to move */ (...) sleep(2.0); /* wait */ (...) Probably the reason why (...) (25 years ago, 2-Mar-00, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|