NXT Motor class.
More...
#include <Motor.h>
List of all members.
Public Member Functions |
| Motor (ePortM port, bool brake=true) |
| Constructor (set brake by default).
|
| ~Motor (void) |
| Destructor (stop the motor).
|
void | reset (void) |
| Stop motor and set motor encoder count to 0.
|
S32 | getCount (void) const |
| Get motor encoder count.
|
void | setCount (S32 count) |
| Set motor encoder count.
|
void | setPWM (S8 pwm) |
| Set motor PWM value.
|
void | setBrake (bool brake) |
| Set brake.
|
Static Public Attributes |
static const S8 | PWM_MAX = 100 |
| Maximum PWM value.
|
static const S8 | PWM_MIN = -100 |
| Minimum PWM value.
|
Protected Member Functions |
ePortM | getPort (void) const |
| Get motor connected port.
|
bool | getBrake (void) const |
| Get brake status.
|
S8 | getPWM (void) const |
| Get current PWM value.
|
Detailed Description
Constructor & Destructor Documentation
Constructor (set brake by default).
Note:
This class must be constructed as a global object. Otherwise, a device assertion will be displayed
in the LCD when the object is constructed as a non global object.
- Parameters:
-
port | Motor connected port |
brake | true:brake/false:float |
- Returns:
- -
Destructor (stop the motor).
- Parameters:
-
- Returns:
- -
Member Function Documentation
Get brake status.
- Parameters:
-
- Returns:
- true:brake/false:float
Get motor encoder count.
- Parameters:
-
- Returns:
- Motor encoder count in degree.
Get motor connected port.
- Parameters:
-
- Returns:
- Motor connected port
Get current PWM value.
- Parameters:
-
- Returns:
- PWM set value
Stop motor and set motor encoder count to 0.
- Parameters:
-
- Returns:
- -
Set brake.
- Parameters:
-
brake | true:brake/false:float |
- Returns:
- -
Set motor encoder count.
- Parameters:
-
count | Motor encoder count in degree. |
- Returns:
- -
Set motor PWM value.
- Parameters:
-
- Returns:
- -
The documentation for this class was generated from the following file: