Driver for Me DC motor device.
More...
#include <src/MeDCMotor.h>
Driver for Me DC motor device.
Class: MeDCMotor
- Description
- Declaration of Class MeDCMotor
- Copyright (C), 2012-2016, MakeBlock
◆ MeDCMotor() [1/2]
| MeDCMotor::MeDCMotor |
( |
void |
| ) |
|
Alternate Constructor which can call your own function to map the DC motor to arduino port, no pins are used or initialized here.
- Parameters
-
◆ MeDCMotor() [2/2]
| MeDCMotor::MeDCMotor |
( |
uint8_t |
port | ) |
|
Alternate Constructor which can call your own function to map the DC motor to arduino port
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
◆ reset() [1/2]
| void MeDCMotor::reset |
( |
uint8_t |
port | ) |
|
- Function
- reset
- Description
- Reset the DC motor available PIN by its RJ25 port.
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
- Output
- None
- Returns
- None
- Others
- None
◆ reset() [2/2]
| void MeDCMotor::reset |
( |
uint8_t |
port, |
|
|
uint8_t |
slot |
|
) |
| |
- Function
- reset
- Description
- Reset the DC motor available PIN by its RJ25 port and slot.
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
| [in] | slot | - SLOT1 or SLOT2 |
- Output
- None
- Returns
- None
- Others
- None
◆ run()
| void MeDCMotor::run |
( |
int16_t |
speed | ) |
|
- Function
- run
- Description
- Control the motor forward or reverse
- Parameters
-
| [in] | speed | - Speed value from -255 to 255 |
- Output
- None
- Returns
- None
- Others
- None
◆ setpin()
| void MeDCMotor::setpin |
( |
uint8_t |
dir_pin, |
|
|
uint8_t |
pwm_pin |
|
) |
| |
- Function
- setpin
- Description
- Reset the DC motor available PIN by its arduino port.
- Parameters
-
| [in] | dir_pin | - arduino port for direction pin(should analog pin) |
| [in] | pwm_pin | - arduino port for pwm input(should analog pin) |
- Output
- None
- Returns
- None
- Others
- None
◆ stop()
| void MeDCMotor::stop |
( |
void |
| ) |
|
- Function
- stop
- Description
- Stop the rotation of the motor
- Output
- None
- Returns
- None
- Others
- None
The documentation for this class was generated from the following files: