CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Servo motor question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
windz



Joined: 19 Aug 2007
Posts: 7

View user's profile Send private message

Servo motor question
PostPosted: Sun Sep 02, 2007 7:36 pm     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 03, 2007 3:25 pm     Reply with quote

It's probably best to ask for help on this servo in an RC group.
They use it a lot. Example:
http://www.rcgroups.com/forums/showthread.php?t=699810
windz



Joined: 19 Aug 2007
Posts: 7

View user's profile Send private message

PostPosted: Mon Sep 03, 2007 6:36 pm     Reply with quote

Oooppss... Sorry, my bad ~ Anyway, Thanks for helping.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group