windz
Joined: 19 Aug 2007 Posts: 7
|
Servo motor question |
Posted: Sun Sep 02, 2007 7:36 pm |
|
|
Hi all, i am using PIC16F877A and Hitec HS-81MG microstep servo motor. I browse through the SEARCH solutions and i came to the coding as belows:
Code: | #include <16F877.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#include <servos.c>
//======================================
void main()
{
init_servos();
while(1)
{
set_servo(LEFT, FORWARD, 2);
delay_ms(500);
set_servo(LEFT, BACKWARD, 2);
delay_ms(500);
}
} |
My question is, why my servo motor seems move 1 step then stall, and keep vibrating? I thought it might move left and right? I am trying to make it to be able to go to 1ms position and 1.5ms position and 2ms position. How am i going to do that? Thx for helping.
The servo.c file are as below:
---
Deleted. Please see forum rules at top of page:
Quote: | 10. Don't post the CCS example code or drivers, or ask for such code and drivers |
-- Forum Moderator |
|