Changeset 788 for firmware/trunk/libraries/servo/servo.c
- Timestamp:
- 08/06/08 13:40:24 (5 months ago)
- Files:
-
- 1 modified
-
firmware/trunk/libraries/servo/servo.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
firmware/trunk/libraries/servo/servo.c
r771 r788 106 106 You can also specify the speed with which the motors will respond to new position commands - a high 107 107 value will result in an immediate response, while a lower value can offer some smoothing when appropriate. 108 109 See the servo section in the <a href="http://www.makingthings.com/documentation/tutorial/application-board-overview/servos"> 110 Application Board overview</a> for more detailed info. 108 111 * \ingroup Libraries 109 112 * @{ … … 116 119 @param state An integer specifying the active state - 1 (active) or 0 (inactive). 117 120 @return Zero on success. 121 122 \b Example 123 \code 124 // enable servo 2 125 Servo_SetActive(2, 1); 126 \endcode 118 127 */ 119 128 int Servo_SetActive( int index, int state ) … … 152 161 @param index An integer specifying which servo (0-3). 153 162 @return State - 1 (active) or 0 (inactive). 163 164 \b Example 165 \code 166 if( Servo_GetActive(2) ) 167 { 168 // Servo 2 is active 169 } 170 else 171 { 172 // Servo 2 is inactive 173 } 174 \endcode 154 175 */ 155 176 int Servo_GetActive( int index ) … … 177 198 @param position An integer specifying the servo position (0 - 1023). 178 199 @return status (0 = OK). 200 201 \b Example 202 \code 203 // set servo 1 to midway through the "safe" range 204 Servo_SetPosition(1, 512); 205 \endcode 179 206 */ 180 207 int Servo_SetPosition( int index, int position ) … … 206 233 @param speed An integer specifying the servo speed (0 - 1023). 207 234 @return status (0 = OK). 235 236 \b Example 237 \code 238 // set servo 1 half speed 239 Servo_SetSpeed(1, 512); 240 \endcode 208 241 */ 209 242 int Servo_SetSpeed( int index, int speed ) … … 229 262 @param index An integer specifying which servo (0 - 3). 230 263 @return The position (0 - 1023), or 0 on error. 264 265 \b Example 266 \code 267 int srv0_pos = Servo_GetPosition(0); 268 // now srv0_pos is the current position 269 \endcode 231 270 */ 232 271 int Servo_GetPosition( int index ) … … 244 283 @param index An integer specifying which servo (0 - 3). 245 284 @return The speed (0 - 1023), or 0 on error. 285 286 \b Example 287 \code 288 int srv0_speed = Servo_GetSpeed(0); 289 // now srv0_speed is the current speed 290 \endcode 246 291 */ 247 292 int Servo_GetSpeed( int index )
