Subject:
|
Re: servo motors
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Thu, 2 Mar 2000 16:13:14 GMT
|
Original-From:
|
Kam Leang <{kleang@eng}spamcake{.utah.edu}>
|
Viewed:
|
1104 times
|
| |
| |
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:
> void main()
> {
> servo_on(); /* on servo */
> servo(3800); /* full left turn */ sleep(2.0); /* wait for 2 seconds for servo to move */
> servo_off(); /* off servo */
> fd(0); /* motor 0 on */
> sleep(2.0); /* for 2 secs */
> servo_on(); /* on servo */ sleep(2.0); /* wait */
> servo(2500); /* mid position */
> servo_off();
> }
Probably the reason why it runs in interactive mode is because you're
pausing between each command when you are sending it to the HB. The sleep
function above should do just that in your code.
Good luck,
kam
______ ______
---------------------------------------------- |_ _| |_ _|
Kam Leang | |______| |______
University of Utah | |_ _| |_ _|
Department of Mechanical Engineering | | | | | | | |
MEB Room 2202 Salt Lake City, UT 84112 | |_|__|_| | | |
(Tel) 801.581.7105 (Fax) 801.585.9826 \ ___________/ | |
http://www.leang.com/kam | |______| |
----------------------------------------------------- \ ___________/
|
|
Message is in Reply To:
| | servo motors
|
| 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 (...) (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
|
|
|
|