Driver for Me Megapi DC motor device.
More...
#include <src/MeMegaPiDCMotor.h>
Driver for Me Megapi DC motor device.
Class: MeMegaPiDCMotor
- Description
- Declaration of Class MeMegaPiDCMotor
- Copyright (C), 2012-2016, MakeBlock
◆ MeMegaPiDCMotor() [1/3]
| MeMegaPiDCMotor::MeMegaPiDCMotor |
( |
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
-
◆ MeMegaPiDCMotor() [2/3]
| MeMegaPiDCMotor::MeMegaPiDCMotor |
( |
uint8_t |
port | ) |
|
Alternate Constructor which can call your own function to map the DC motor to arduino port
- Parameters
-
| [in] | port | - megapi dc port from PORT_1 to PORT_12 |
◆ MeMegaPiDCMotor() [3/3]
| MeMegaPiDCMotor::MeMegaPiDCMotor |
( |
uint8_t |
dc_dir_h1, |
|
|
uint8_t |
dc_dir_h2, |
|
|
uint8_t |
pwm_pin |
|
) |
| |
Alternate Constructor which can call your own function to map the DC motor to arduino port, it will assigned the output pin.
- Parameters
-
| [in] | dc_dir_h1 | - arduino port for direction pin1 |
| [in] | dc_dir_h2 | - arduino port for direction pin2 |
| [in] | pwm_pin | - arduino port for pwm input(should analog pin) |
◆ reset()
| void MeMegaPiDCMotor::reset |
( |
uint8_t |
port | ) |
|
- Function
- setpin
- Description
- Reset the DC motor available PIN by megapi port.
- Parameters
-
| [in] | port | - megapi dc port from PORT_1 to PORT_12 |
- Output
- None
- Returns
- None
- Others
- None
- Function
- reset
- Description
- Reset the DC motor available PIN by megapi port.
- Parameters
-
| [in] | port | - megapi dc port from PORT_1 to PORT_12 |
- Output
- None
- Returns
- None
- Others
- None
◆ run()
| void MeMegaPiDCMotor::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 MeMegaPiDCMotor::setpin |
( |
uint8_t |
dc_dir_h1, |
|
|
uint8_t |
dc_dir_h2, |
|
|
uint8_t |
pwm_pin |
|
) |
| |
- Function
- setpin
- Description
- Reset the DC motor available PIN by its arduino port.
- Parameters
-
| [in] | dc_dir_h1 | - arduino port for direction pin1 |
| [in] | dc_dir_h2 | - arduino port for direction pin2 |
| [in] | pwm_pin | - arduino port for pwm input(should analog pin) |
- Output
- None
- Returns
- None
- Others
- None
◆ stop()
| void MeMegaPiDCMotor::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: