?lang_form?
?lang_select?
?lang_submit?
?lang_endform?
{HEADER END}
{FILE START}
library
?curdirlinks? - Rev 6
?prevdifflink? - Blame - ?getfile?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Procyon AVRlib: Interrupt-driven RC Servo Function Library (servo.c)</title>
<link href="dox.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>Interrupt-driven RC Servo Function Library (servo.c)<br>
<small>
[<a class="el" href="group__driver__sw.html">Drivers (software-based)</a>]</small>
</h1><div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "<a class="code" href="servo_8h.html">servo.h</a>"</span>
</pre></div> <dl compact><dt><b>Overview</b></dt><dd>This code allows you to drive up to 8 RC servos from any combination of ports and pins on the AVR processor. Using interrupts, this code continuously sends control signals to the servo to maintain position even while your code is doing other work.</dd></dl>
The servoInit and servoOff effectively turn on and turn off servo control. When you run ServoInit, it automatically assigns each "channel" of servo control to be output on the SERVO_DEFAULT_PORT. One "channel" of servo control can control one servo and must be assigned single I/O pin for output.<p>
If you're using all eight channels (SERVO_NUM_CHANNELS = 8), then then by default the code will use SERVO_DEFAULT_PORT pins 0-7. If you're only using four channels, then pins 0-3 will be used by default.<p>
The command servoSetChannelIO(channel, port, pin) allows you to reassign the output of any channel to any port and I/O pin you choose. For exampe, if you have an RC servo connected to PORTC, pin 6, and you wish to use channel 2 to control it, use:<p>
servoSerChannelIO( 2, _SFR_IO_ADDR(PORTC), 6)<p>
(NOTE: you must include the "_SRF_IO_ADDR()" part around your port)<p>
The servoSetPostion and servoGetPosition commands allow you to command a given servo to your desired position. The position you request must lie between the SERVO_MIN and SERVO_MAX limit you defined.<p>
: This servo library has been tested to work without issue on several different AVR processors and with several different brands/kinds of servos. However:<ul>
<li>Proper output duty cylces are dependent upon a user calibation and configuration.</li><li>IF YOUR SERVOS ARE EXCEPTIONALLY POWERFUL, AN ERRONEOUS OUTPUT DUTY CYCLE GENERATED FROM THIS CODE OR ANY OTHER SOURCE CAN DAMAGE YOUR SERVO'S INTERNAL DRIVER CHIP OR ITS GEARS!</li><li>I have never experienced any servo damage from erroneous control signal input, but it is possible. </li></ul>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>
<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 29 03:41:09 2006 for Procyon AVRlib by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|
{FILE END}
{FOOTER START}
Powered by WebSVN v2.8.3