Controlling a servo in C

Status
Not open for further replies.
I want to create a simple servo controller in C language, but I dont know know how to use C to create timing. I want to use 1.75millesecond pulses to control a servo to a position but I dont know how to create 1.75millesecond pulses. Please help me.
 
I want to create a simple servo controller in C language, but I dont know know how to use C to create timing. I want to use 1.75millesecond pulses to control a servo to a position but I dont know how to create 1.75millesecond pulses. Please help me.
Don't use C to create the timing! Use the PIC's timers. Have a look at Pommie's code in this thread.

If you're newbier than that, there's some simple servo control discussion in this thread, along with a very simple C servo control demo. Be aware though, that demo code of mine there is NOT the proper way to control a servo. It's only a quick demo. The proper way is to use timers and interrupts.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…