root / branches / wireless / docs / libdragonfly / html / group__motors.html @ 1578
History | View | Annotate | Download (15 KB)
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
---|---|
2 |
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
3 |
<title>Colony: Motors</title> |
4 |
<link href="tabs.css" rel="stylesheet" type="text/css"> |
5 |
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
6 |
</head><body> |
7 |
<!-- Generated by Doxygen 1.5.8 -->
|
8 |
<div class="navigation" id="top"> |
9 |
<div class="tabs"> |
10 |
<ul>
|
11 |
<li><a href="index.html"><span>Main Page</span></a></li> |
12 |
<li><a href="pages.html"><span>Related Pages</span></a></li> |
13 |
<li><a href="modules.html"><span>Modules</span></a></li> |
14 |
<li><a href="annotated.html"><span>Data Structures</span></a></li> |
15 |
<li><a href="files.html"><span>Files</span></a></li> |
16 |
</ul>
|
17 |
</div>
|
18 |
</div>
|
19 |
<div class="contents"> |
20 |
<h1>Motors</h1>Functions for controlling the motors. Functions for controlling the motors. Found in <a class="el" href="motor_8h.html" title="Contains definitions for controlling the motors.">motor.h</a>. |
21 |
<a href="#_details">More...</a> |
22 |
<p>
|
23 |
<table border="0" cellpadding="0" cellspacing="0"> |
24 |
<tr><td></td></tr> |
25 |
<tr><td colspan="2"><br><h2>Defines</h2></td></tr> |
26 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g6ddfdda7a062d10cff4a72b76b44aeb8"></a><!-- doxytag: member="motors::FORWARD" ref="g6ddfdda7a062d10cff4a72b76b44aeb8" args="" --> |
27 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#g6ddfdda7a062d10cff4a72b76b44aeb8">FORWARD</a> 1</td></tr> |
28 |
|
29 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">make the motors go forwards <br></td></tr> |
30 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gdf445abfe1b77fa63f89e315ccc2f7f2"></a><!-- doxytag: member="motors::BACKWARD" ref="gdf445abfe1b77fa63f89e315ccc2f7f2" args="" --> |
31 |
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#gdf445abfe1b77fa63f89e315ccc2f7f2">BACKWARD</a> 0</td></tr> |
32 |
|
33 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">make the motors go backwards <br></td></tr> |
34 |
<tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
35 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171">motors_init</a> (void)</td></tr> |
36 |
|
37 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the motors. <a href="#gea7444d04318aa45160930076e001171"></a><br></td></tr> |
38 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#gfe038834955f829de5c86c6a917c300e">motor_l_set</a> (int direction, int speed)</td></tr> |
39 |
|
40 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set speed and direction of left motor. <a href="#gfe038834955f829de5c86c6a917c300e"></a><br></td></tr> |
41 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#g254142b132fadd958176eb5d05399741">motor_r_set</a> (int direction, int speed)</td></tr> |
42 |
|
43 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set speed and direction of right motor. <a href="#g254142b132fadd958176eb5d05399741"></a><br></td></tr> |
44 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#g7ffe2df820859a9d0d01ce248b63764d">motor1_set</a> (int direction, int speed)</td></tr> |
45 |
|
46 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set speed and direction of motor1. <a href="#g7ffe2df820859a9d0d01ce248b63764d"></a><br></td></tr> |
47 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#g37c26949f041012fbee44c97be505ab5">motor2_set</a> (int direction, int speed)</td></tr> |
48 |
|
49 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set speed and direction of motor2. <a href="#g37c26949f041012fbee44c97be505ab5"></a><br></td></tr> |
50 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__motors.html#gd80ca701deea57fea1a1f38e8a71f7c6">motors_off</a> (void)</td></tr> |
51 |
|
52 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Turn the motors off. <a href="#gd80ca701deea57fea1a1f38e8a71f7c6"></a><br></td></tr> |
53 |
<tr><td colspan="2"><br><h2>Variables</h2></td></tr> |
54 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g8f87e0e7ef1efe7788edf8133862dbf5"></a><!-- doxytag: member="motors::motors_initd" ref="g8f87e0e7ef1efe7788edf8133862dbf5" args="" --> |
55 |
unsigned char </td><td class="memItemRight" valign="bottom"><b>motors_initd</b> = 0</td></tr> |
56 |
|
57 |
</table>
|
58 |
<hr><a name="_details"></a><h2>Detailed Description</h2> |
59 |
Functions for controlling the motors. Functions for controlling the motors. Found in <a class="el" href="motor_8h.html" title="Contains definitions for controlling the motors.">motor.h</a>. <hr><h2>Function Documentation</h2> |
60 |
<a class="anchor" name="g7ffe2df820859a9d0d01ce248b63764d"></a><!-- doxytag: member="motor.c::motor1_set" ref="g7ffe2df820859a9d0d01ce248b63764d" args="(int direction, int speed)" --> |
61 |
<div class="memitem"> |
62 |
<div class="memproto"> |
63 |
<table class="memname"> |
64 |
<tr>
|
65 |
<td class="memname">int motor1_set </td> |
66 |
<td>(</td> |
67 |
<td class="paramtype">int </td> |
68 |
<td class="paramname"> <em>direction</em>, </td> |
69 |
</tr>
|
70 |
<tr>
|
71 |
<td class="paramkey"></td> |
72 |
<td></td> |
73 |
<td class="paramtype">int </td> |
74 |
<td class="paramname"> <em>speed</em></td><td> </td> |
75 |
</tr>
|
76 |
<tr>
|
77 |
<td></td> |
78 |
<td>)</td> |
79 |
<td></td><td></td><td></td> |
80 |
</tr>
|
81 |
</table>
|
82 |
</div>
|
83 |
<div class="memdoc"> |
84 |
|
85 |
<p>
|
86 |
Set speed and direction of motor1. |
87 |
<p>
|
88 |
Sets the speed and direction of motor1. motors_init must be called before this function can be used.<p>
|
89 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
90 |
<table border="0" cellspacing="2" cellpadding="0"> |
91 |
<tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Either FORWARD or BACKWARD to set the direction of rotation. </td></tr> |
92 |
<tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The speed the motor will run at, in the range 0-255.</td></tr> |
93 |
</table>
|
94 |
</dl>
|
95 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
96 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#g37c26949f041012fbee44c97be505ab5" title="Set speed and direction of motor2.">motor2_set</a>, <a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171" title="Initialize the motors.">motors_init</a></dd></dl> |
97 |
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>use the left motor function instead. it's more intuitive and easier to read. </dd></dl> |
98 |
|
99 |
</div>
|
100 |
</div><p> |
101 |
<a class="anchor" name="g37c26949f041012fbee44c97be505ab5"></a><!-- doxytag: member="motor.c::motor2_set" ref="g37c26949f041012fbee44c97be505ab5" args="(int direction, int speed)" --> |
102 |
<div class="memitem"> |
103 |
<div class="memproto"> |
104 |
<table class="memname"> |
105 |
<tr>
|
106 |
<td class="memname">int motor2_set </td> |
107 |
<td>(</td> |
108 |
<td class="paramtype">int </td> |
109 |
<td class="paramname"> <em>direction</em>, </td> |
110 |
</tr>
|
111 |
<tr>
|
112 |
<td class="paramkey"></td> |
113 |
<td></td> |
114 |
<td class="paramtype">int </td> |
115 |
<td class="paramname"> <em>speed</em></td><td> </td> |
116 |
</tr>
|
117 |
<tr>
|
118 |
<td></td> |
119 |
<td>)</td> |
120 |
<td></td><td></td><td></td> |
121 |
</tr>
|
122 |
</table>
|
123 |
</div>
|
124 |
<div class="memdoc"> |
125 |
|
126 |
<p>
|
127 |
Set speed and direction of motor2. |
128 |
<p>
|
129 |
Sets the speed and direction of motor2. motors_init must be called before this function can be used.<p>
|
130 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
131 |
<table border="0" cellspacing="2" cellpadding="0"> |
132 |
<tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Either FORWARD or BACKWARD to set the direction of rotation. </td></tr> |
133 |
<tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The speed the motor will run at, in the range 0-255.</td></tr> |
134 |
</table>
|
135 |
</dl>
|
136 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
137 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#g37c26949f041012fbee44c97be505ab5" title="Set speed and direction of motor2.">motor2_set</a>, <a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171" title="Initialize the motors.">motors_init</a></dd></dl> |
138 |
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>use the right motor function instead. it's more intuitive and easier to read. </dd></dl> |
139 |
|
140 |
</div>
|
141 |
</div><p> |
142 |
<a class="anchor" name="gfe038834955f829de5c86c6a917c300e"></a><!-- doxytag: member="motor.c::motor_l_set" ref="gfe038834955f829de5c86c6a917c300e" args="(int direction, int speed)" --> |
143 |
<div class="memitem"> |
144 |
<div class="memproto"> |
145 |
<table class="memname"> |
146 |
<tr>
|
147 |
<td class="memname">int motor_l_set </td> |
148 |
<td>(</td> |
149 |
<td class="paramtype">int </td> |
150 |
<td class="paramname"> <em>direction</em>, </td> |
151 |
</tr>
|
152 |
<tr>
|
153 |
<td class="paramkey"></td> |
154 |
<td></td> |
155 |
<td class="paramtype">int </td> |
156 |
<td class="paramname"> <em>speed</em></td><td> </td> |
157 |
</tr>
|
158 |
<tr>
|
159 |
<td></td> |
160 |
<td>)</td> |
161 |
<td></td><td></td><td></td> |
162 |
</tr>
|
163 |
</table>
|
164 |
</div>
|
165 |
<div class="memdoc"> |
166 |
|
167 |
<p>
|
168 |
Set speed and direction of left motor. |
169 |
<p>
|
170 |
Sets the speed and direction of the left motor. motors_init must be called before this function can be used.<p>
|
171 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
172 |
<table border="0" cellspacing="2" cellpadding="0"> |
173 |
<tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Either FORWARD or BACKWARD to set the direction of rotation. </td></tr> |
174 |
<tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The speed the motor will run at, in the range 0-255.</td></tr> |
175 |
</table>
|
176 |
</dl>
|
177 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
178 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#g254142b132fadd958176eb5d05399741" title="Set speed and direction of right motor.">motor_r_set</a>, <a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171" title="Initialize the motors.">motors_init</a> </dd></dl> |
179 |
|
180 |
</div>
|
181 |
</div><p> |
182 |
<a class="anchor" name="g254142b132fadd958176eb5d05399741"></a><!-- doxytag: member="motor.c::motor_r_set" ref="g254142b132fadd958176eb5d05399741" args="(int direction, int speed)" --> |
183 |
<div class="memitem"> |
184 |
<div class="memproto"> |
185 |
<table class="memname"> |
186 |
<tr>
|
187 |
<td class="memname">int motor_r_set </td> |
188 |
<td>(</td> |
189 |
<td class="paramtype">int </td> |
190 |
<td class="paramname"> <em>direction</em>, </td> |
191 |
</tr>
|
192 |
<tr>
|
193 |
<td class="paramkey"></td> |
194 |
<td></td> |
195 |
<td class="paramtype">int </td> |
196 |
<td class="paramname"> <em>speed</em></td><td> </td> |
197 |
</tr>
|
198 |
<tr>
|
199 |
<td></td> |
200 |
<td>)</td> |
201 |
<td></td><td></td><td></td> |
202 |
</tr>
|
203 |
</table>
|
204 |
</div>
|
205 |
<div class="memdoc"> |
206 |
|
207 |
<p>
|
208 |
Set speed and direction of right motor. |
209 |
<p>
|
210 |
Sets the speed and direction of the right motor. motors_init must be called before this function can be used.<p>
|
211 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
212 |
<table border="0" cellspacing="2" cellpadding="0"> |
213 |
<tr><td valign="top"></td><td valign="top"><em>direction</em> </td><td>Either FORWARD or BACKWARD to set the direction of rotation. </td></tr> |
214 |
<tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The speed the motor will run at, in the range 0-255.</td></tr> |
215 |
</table>
|
216 |
</dl>
|
217 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
218 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#gfe038834955f829de5c86c6a917c300e" title="Set speed and direction of left motor.">motor_l_set</a>, <a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171" title="Initialize the motors.">motors_init</a> </dd></dl> |
219 |
|
220 |
</div>
|
221 |
</div><p> |
222 |
<a class="anchor" name="gea7444d04318aa45160930076e001171"></a><!-- doxytag: member="motor.c::motors_init" ref="gea7444d04318aa45160930076e001171" args="(void)" --> |
223 |
<div class="memitem"> |
224 |
<div class="memproto"> |
225 |
<table class="memname"> |
226 |
<tr>
|
227 |
<td class="memname">int motors_init </td> |
228 |
<td>(</td> |
229 |
<td class="paramtype">void </td> |
230 |
<td class="paramname"> </td> |
231 |
<td> ) </td> |
232 |
<td></td> |
233 |
</tr>
|
234 |
</table>
|
235 |
</div>
|
236 |
<div class="memdoc"> |
237 |
|
238 |
<p>
|
239 |
Initialize the motors. |
240 |
<p>
|
241 |
Initializes both motors so that they can be used with future calls to motor1_set and motor2_set.<p>
|
242 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
243 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#gd80ca701deea57fea1a1f38e8a71f7c6" title="Turn the motors off.">motors_off</a>, <a class="el" href="group__motors.html#g7ffe2df820859a9d0d01ce248b63764d" title="Set speed and direction of motor1.">motor1_set</a>, <a class="el" href="group__motors.html#g37c26949f041012fbee44c97be505ab5" title="Set speed and direction of motor2.">motor2_set</a> </dd></dl> |
244 |
|
245 |
</div>
|
246 |
</div><p> |
247 |
<a class="anchor" name="gd80ca701deea57fea1a1f38e8a71f7c6"></a><!-- doxytag: member="motor.c::motors_off" ref="gd80ca701deea57fea1a1f38e8a71f7c6" args="(void)" --> |
248 |
<div class="memitem"> |
249 |
<div class="memproto"> |
250 |
<table class="memname"> |
251 |
<tr>
|
252 |
<td class="memname">int motors_off </td> |
253 |
<td>(</td> |
254 |
<td class="paramtype">void </td> |
255 |
<td class="paramname"> </td> |
256 |
<td> ) </td> |
257 |
<td></td> |
258 |
</tr>
|
259 |
</table>
|
260 |
</div>
|
261 |
<div class="memdoc"> |
262 |
|
263 |
<p>
|
264 |
Turn the motors off. |
265 |
<p>
|
266 |
Turns off both motors.<p>
|
267 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if init succesfull, an error code otherwise</dd></dl> |
268 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__motors.html#gea7444d04318aa45160930076e001171" title="Initialize the motors.">motors_init</a> </dd></dl> |
269 |
|
270 |
</div>
|
271 |
</div><p> |
272 |
</div>
|
273 |
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Nov 20 21:51:59 2009 for Colony by |
274 |
<a href="http://www.doxygen.org/index.html"> |
275 |
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
276 |
</body>
|
277 |
</html>
|