Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SeeedStudioShieldBot Class Reference
Seeed Studio Shield Bot Control Class In order to use this properly, you need to connect a jumper between pins eight and three on the shield bot, and you can't use either pins 8 or 3, which correspond to PTA13 and PTA12, respectively. More...
#include <SeeedStudioShieldBot.h>
Public Member Functions | |
| void | left_motor (float speed) |
| Switch on the left motor at the given speed. | |
| void | right_motor (float speed) |
| Switch on the right motor at the given speed. | |
| void | forward (float speed) |
| Switch on both motors, forwards at the given speed. | |
| void | backward (float speed) |
| Switch on both motors, backwards at the given speed. | |
| void | left (float speed) |
| Switch on both motors at the given speed, in opposite directions so as to turn left. | |
| void | right (float speed) |
| Switch on both motors at the given speed, in opposite directions so as to turn right. | |
| void | disable_left_motor () |
| Disable the left motor, by driving enable pin for the second motor low... | |
| void | disable_right_motor () |
| Disable the left motor, by driving enable pin for the first motor low... | |
| void | enable_left_motor () |
| Enable the left motor, by driving enable pin for the second motor high... | |
| void | enable_right_motor () |
| Enable the left motor, by driving enable pin for the first motor high... | |
| void | stopAll () |
| Stop both motors at the same time. | |
| void | stop (int motor) |
| Stop a chosen motor. | |
| float | line_position () |
| Gives an indication of the data given by the reflectivity sensors. | |
Detailed Description
Seeed Studio Shield Bot Control Class In order to use this properly, you need to connect a jumper between pins eight and three on the shield bot, and you can't use either pins 8 or 3, which correspond to PTA13 and PTA12, respectively.
Also, in order to provide power to the freedom board, when running just of a lipo battery, you need to connect between 5V and VIN on the shield bot. Code/notes above only tested with version 0.9b, may not be needed/may not work in other cases...
Definition at line 8 of file SeeedStudioShieldBot.h.
Member Function Documentation
| void backward | ( | float | speed ) |
Switch on both motors, backwards at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 72 of file SeeedStudioShieldBot.cpp.
| void disable_left_motor | ( | ) |
Disable the left motor, by driving enable pin for the second motor low...
Definition at line 95 of file SeeedStudioShieldBot.cpp.
| void disable_right_motor | ( | ) |
Disable the left motor, by driving enable pin for the first motor low...
Definition at line 91 of file SeeedStudioShieldBot.cpp.
| void enable_left_motor | ( | ) |
Enable the left motor, by driving enable pin for the second motor high...
Definition at line 87 of file SeeedStudioShieldBot.cpp.
| void enable_right_motor | ( | ) |
Enable the left motor, by driving enable pin for the first motor high...
Definition at line 83 of file SeeedStudioShieldBot.cpp.
| void forward | ( | float | speed ) |
Switch on both motors, forwards at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 61 of file SeeedStudioShieldBot.cpp.
| void left | ( | float | speed ) |
Switch on both motors at the given speed, in opposite directions so as to turn left.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motors.
Definition at line 45 of file SeeedStudioShieldBot.cpp.
| void left_motor | ( | float | speed ) |
Switch on the left motor at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 31 of file SeeedStudioShieldBot.cpp.
| float line_position | ( | ) |
Gives an indication of the data given by the reflectivity sensors.
Definition at line 102 of file SeeedStudioShieldBot.cpp.
| void right | ( | float | speed ) |
Switch on both motors at the given speed, in opposite directions so as to turn right.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motors.
Definition at line 50 of file SeeedStudioShieldBot.cpp.
| void right_motor | ( | float | speed ) |
Switch on the right motor at the given speed.
- Parameters:
-
speed The speed, from 0.0 to 1.0 at which to spin the motor.
Definition at line 19 of file SeeedStudioShieldBot.cpp.
| void stop | ( | int | motor ) |
Stop a chosen motor.
- Parameters:
-
motor Number, either 1 or 2 choosing the motor.
Definition at line 127 of file SeeedStudioShieldBot.cpp.
| void stopAll | ( | ) |
Stop both motors at the same time.
Different to disable.
Definition at line 120 of file SeeedStudioShieldBot.cpp.
Generated on Wed Jul 20 2022 04:25:07 by
1.7.2
Seeed Studio Shield Bot