-
Notifications
You must be signed in to change notification settings - Fork 0
MiP_Motion
Manages MiP's drive system.
Signature: constexpr uint8_t MIP_CMD_CONTINUOUS_DRIVE
Summary: MiP protocol command bytes used by the motion subsystem.
Details:
These values are placed in the first byte of requests sent to the MiP (and appear in the corresponding responses). See the official MiP BLE Protocol for the complete list.
Signature: constexpr uint8_t MIP_CMD_DISTANCE_DRIVE
Signature: constexpr uint8_t MIP_CMD_TURN_LEFT
Signature: constexpr uint8_t MIP_CMD_TURN_RIGHT
Signature: constexpr uint8_t MIP_CMD_DRIVE_FORWARD
Signature: constexpr uint8_t MIP_CMD_DRIVE_BACKWARD
Signature: constexpr uint8_t MIP_CMD_STOP
Signature: constexpr uint8_t MIP_CMD_SET_POSITION
Signature: constexpr uint8_t MIP_CMD_GET_UP
Signature: constexpr uint8_t MIP_CONTINUOUS_DRIVE_DELAY
Signature: MiP_Motion(MiP &mip)
Summary: Constructs the drive system manager.
Parameters:
| Parameter | Description |
|---|---|
mip |
A reference to the main MiP object to access core services. |
Signature: void continuousDrive(int8_t velocity, int8_t turnRate)
Summary: Sends continuous drive command (velocity + turn rate).
Details:
Rate-limited internally to avoid overwhelming the MiP (~20 Hz max). Fire-and-forget (no verification possible).
Parameters:
| Parameter | Description |
|---|---|
velocity |
-32 to +32 (negative = backward). |
turnRate |
-32 to +32 (negative = left). |
Signature: void distanceDrive(MiPDriveDirection driveDirection, uint8_t cm, MiPTurnDirection turnDirection, uint16_t degrees)
Summary: Drives a specific distance then optionally turns.
Details:
Fire-and-forget command.
Parameters:
| Parameter | Description |
|---|---|
driveDirection |
Forward or backward. |
cm |
Distance in centimeters. |
turnDirection |
Turn direction after driving. |
degrees |
Turn angle in degrees (0-360). |
Signature: void driveForward(uint8_t speed, uint16_t time)
Summary: Drives forward for a limited time at given speed.
Details:
Fire-and-forget. Time is internally converted to 7ms units.
Parameters:
| Parameter | Description |
|---|---|
speed |
Drive speed (0-30). |
time |
Duration in milliseconds (max ~1.78 seconds). |
Signature: void driveBackward(uint8_t speed, uint16_t time)
Summary: Drives backward for a limited time at given speed.
Details:
Fire-and-forget. Time is internally converted to 7ms units.
Parameters:
| Parameter | Description |
|---|---|
speed |
Drive speed (0-30). |
time |
Duration in milliseconds (max ~1.78 seconds). |
Signature: void turnLeft(uint16_t degrees, uint8_t speed)
Summary: Turns left by the specified angle at given speed.
Details:
Fire-and-forget. Angle is internally converted to 5° units.
Parameters:
| Parameter | Description |
|---|---|
degrees |
Turn angle (max 1275°). |
speed |
Turn speed (0-24). |
Signature: void turnRight(uint16_t degrees, uint8_t speed)
Summary: Turns right by the specified angle at given speed.
Details:
Fire-and-forget. Angle is internally converted to 5° units.
Parameters:
| Parameter | Description |
|---|---|
degrees |
Turn angle (max 1275°). |
speed |
Turn speed (0-24). |
Signature: void stop()
Summary: Stops all motion.
Details:
Fire-and-forget.
Signature: void fallForward()
Summary: Commands MiP to fall forward (face down).
Signature: void fallBackward()
Summary: Commands MiP to fall backward (on its back).
Signature: void getUp(MiPGetUp getup=MIP_GETUP_FROM_EITHER)
Summary: Commands MiP to get up from a fallen position.
Parameters:
| Parameter | Description |
|---|---|
getup |
Which way to attempt getting up (default = either side). |
🔗 Quick Links: Main Repository • Report an Issue • Wiki Home
An open-source API for the WowWee MiP Robot. Licensed under Apache-2.0.
- MiP
- MiPChestLED
- MiPClapSettings
- MiPDebug
- MiPHardwareInfo
- MiPHeadLEDs
- MiPIRDongleCode
- MiPSoftwareVersion
- MiPStatus
- MiP_Battery
- MiP_ChestLED
- MiP_Clap
- MiP_EEPROM
- MiP_Gesture
- MiP_HeadLEDs
- MiP_Infrared
- MiP_Mode
- MiP_Motion
- MiP_Odometer
- MiP_Position
- MiP_Radar
- MiP_Serial
- MiP_Shake
- MiP_Sound
- MiP_Version
- MiP_Weight
- MiP_WiFi