MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MBotDCMotor Class Reference

#include <src/MeMbotDCMotor.h>

Inheritance diagram for MBotDCMotor:
Collaboration diagram for MBotDCMotor:

Public Member Functions

 MBotDCMotor (uint8_t port)
 
void move (int direction, int speed)
 
- Public Member Functions inherited from MeDCMotor
 MeDCMotor (void)
 
 MeDCMotor (uint8_t port)
 
void setpin (uint8_t dir_pin, uint8_t pwm_pin)
 
void reset (uint8_t port)
 
void reset (uint8_t port, uint8_t slot)
 
void run (int16_t speed)
 
void stop (void)
 
- Public Member Functions inherited from MePort
 MePort (void)
 
 MePort (uint8_t port)
 
 MePort (uint8_t port, uint8_t slot)
 
uint8_t getPort (void)
 
uint8_t getSlot (void)
 
bool dRead1 (uint8_t mode=INPUT)
 
bool dRead2 (uint8_t mode=INPUT)
 
bool dpRead1 (void)
 
bool dpRead2 (void)
 
void dWrite1 (bool value)
 
void dWrite2 (bool value)
 
int16_t aRead1 (void)
 
int16_t aRead2 (void)
 
void aWrite1 (int16_t value)
 
void aWrite2 (int16_t value)
 
void reset (uint8_t port)
 
void reset (uint8_t port, uint8_t slot)
 
uint8_t pin1 (void)
 
uint8_t pin2 (void)
 
uint8_t pin (void)
 
uint8_t pin (uint8_t port, uint8_t slot)
 

Additional Inherited Members

- Protected Attributes inherited from MePort
uint8_t s1
 
uint8_t s2
 
uint8_t _port
 
uint8_t _slot
 

Detailed Description

Class: MBotDCMotor

Description
Declaration of Class MBotDCMotor.

Constructor & Destructor Documentation

◆ MBotDCMotor()

MBotDCMotor::MBotDCMotor ( uint8_t  port)

Alternate Constructor which can call your own function to map the MBot DCMotor to arduino port, the slot2 pin will be used here since specify slot is not be set.

Parameters
[in]port- RJ25 port from PORT_1 to M2

Member Function Documentation

◆ move()

void MBotDCMotor::move ( int  direction,
int  speed 
)
Function
move
Description
MBot DCMotor moves with the speed and direction.
Parameters
[in]direction- The direction of the MBot DCMotor's movement
[in]speed- The speed of MBot DCMotor's movement.
Output
None
Return
None
Others
None

The documentation for this class was generated from the following files: