![]() |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Adds a layer over servo library for use with a differential servo drive robot. You have to add the simpletools and servo libraries to your project (with the Add Simple Libraries button) for this to work. More...
Include dependency graph for servodiffdrive.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| void | drive_pins (int left, int right) |
| Set up left and right wheel servo pin connections. More... | |
| void | drive_speeds (int left, int right) |
| Set the servo drive speeds. More... | |
| void | drive_setramp (int left, int right) |
| Set the maximum ramp step size. More... | |
| void | drive_sleep () |
| Stops the drive wheel servo signals without stopping the processor that controls them. More... | |
| void | drive_stop () |
| Stops the processor that controls all servos in the application. More... | |
Adds a layer over servo library for use with a differential servo drive robot. You have to add the simpletools and servo libraries to your project (with the Add Simple Libraries button) for this to work.
@detail Functions that control servo speeds and directions automatically reverse servo speed on the right side to make intuitive functions that involve positive values for forward and negative ones for backward.
speed control calls typically set up once with drivePins(left, right). After that driveSpeeds(speedLeft, speedRight) control servo speed and direction. Example: driveSpeed(200, 200) is full speed forward. Likewise, driveSpeed(-200, -200) is full speed reverse.
Please submit bug reports, suggestions, and improvements to this code to editor@parallax.com.
Definition in file servodiffdrive.h.
| void drive_pins | ( | int | left, |
| int | right | ||
| ) |
Set up left and right wheel servo pin connections.
@detail Call this function once to tell the library which pins the left and right continuous rotation drive servos are connected to.
| left | Left servo pin |
| right | Right servo pin |
Definition at line 6 of file servodiffdrive.c.
| void drive_setramp | ( | int | left, |
| int | right | ||
| ) |
Set the maximum ramp step size.
@detail Call this function if you want a large change in speed to be reached incrementally for a ramping effect. Default is 2000 (no ramping whatsoever). values in the 4 to 10 range tend to have a visible effect. 4 is a little sluggish but works well for gradual speed changes that are useful in hill climbing applications.
| left | Left sevo maximum ramp step |
| right | Right servo maximum ramp step |
Definition at line 18 of file servodiffdrive.c.
Here is the call graph for this function:| void drive_sleep | ( | ) |
Stops the drive wheel servo signals without stopping the processor that controls them.
@detail This function is useful for stopping the control signals to the drive wheel servos without stopping signals to the rest of the servos. You can call driveSpeeds to wake the servos back up. This can save some power if your application needs to operate other servos while giving the continuous rotation drive servos a rest.
| left | Left sevo maximum ramp step |
| right | Right servo maximum ramp step |
Definition at line 24 of file servodiffdrive.c.
Here is the call graph for this function:| void drive_speeds | ( | int | left, |
| int | right | ||
| ) |
Set the servo drive speeds.
@detail Speeds range from 100 for full speed forward to -100 for full speed reverse. To ensure that both servos are turning at full speeds, 200 is typically used for forward and -200 for backward. Then, linear speed control happens in the -100...0...100 range.
| left | Left srvo speed |
| right | Right servo speed |
Definition at line 12 of file servodiffdrive.c.
Here is the call graph for this function:| void drive_stop | ( | ) |
Stops the processor that controls all servos in the application.
@detail This function takes all servos in the application out of commission, and all settings will be lost. Use at the end of the program for maximum power savings.
| left | Left sevo maximum ramp step |
| right | Right servo maximum ramp step |
Definition at line 30 of file servodiffdrive.c.
Here is the call graph for this function:
1.8.17