MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
Public Member Functions | List of all members
MeMegaPiPro4DcMotor Class Reference

Driver for Me DC motor device. More...

`#include <src/MeMegaPiPro4DcMotor.h>`

Inheritance diagram for MeMegaPiPro4DcMotor:
[legend]
Collaboration diagram for MeMegaPiPro4DcMotor:
[legend]

## Public Member Functions
| MeMegaPiPro4DcMotor (void)
| MeMegaPiPro4DcMotor (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

Driver for Me DC motor device.

Class: MeMegaPiPro4DcMotor

Description
  Declaration of Class MeMegaPiPro4DcMotor

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeMegaPiPro4DcMotor() [1/2]

MeMegaPiPro4DcMotor::MeMegaPiPro4DcMotor | ( | 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

  [in] | None |

## ◆ MeMegaPiPro4DcMotor() [2/2]

MeMegaPiPro4DcMotor::MeMegaPiPro4DcMotor | ( | 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

## Member Function Documentation

## ◆ reset() [1/2]

void MeMegaPiPro4DcMotor::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 MeMegaPiPro4DcMotor::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 MeMegaPiPro4DcMotor::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 MeMegaPiPro4DcMotor::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 MeMegaPiPro4DcMotor::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:

- src/MeMegaPiPro4DcMotor.h
- src/MeMegaPiPro4DcMotor.cpp