MakeBlock Drive Updated Updated library for MakeBlock Ranger

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

Class for Encoder Motor Driver. More...

`#include <src/MeEncoderMotor.h>`

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

## Public Member Functions
| MeEncoderMotor (uint8_t addr, uint8_t slot)
| MeEncoderMotor (uint8_t slot)
| MeEncoderMotor ()
void | begin ()
boolean | reset ()
boolean | move (float angle, float speed)
boolean | moveTo (float angle, float speed)
boolean | runTurns (float turns, float speed)
boolean | runSpeed (float speed)
boolean | runSpeedAndTime (float speed, float time)
float | getCurrentSpeed ()
float | getCurrentPosition ()
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 for Encoder Motor Driver.

Driver for Me Encoder Motor module.

Driver for Encoder Motor module.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeEncoderMotor() [1/3]

MeEncoderMotor::MeEncoderMotor | ( | uint8_t | addr,
|  | uint8_t | slot
| ) |  |

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device.

Parameters

  [in] | port | - RJ25 port from PORT_1 to M2
  [in] | slot | - SLOT1 or SLOT2

## ◆ MeEncoderMotor() [2/3]

MeEncoderMotor::MeEncoderMotor | ( | uint8_t | slot | ) |

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you can set any slot for the Encoder Motor device.

Parameters

  [in] | slot | - SLOT1 or SLOT2

## ◆ MeEncoderMotor() [3/3]

MeEncoderMotor::MeEncoderMotor | ( |  | ) |

Alternate Constructor which can call your own function to map the Encoder Motor to arduino port, you should initialized slot and slaveAddress here for the Encoder Motor device.

Parameters

  [in] | None |

## Member Function Documentation

## ◆ begin()

void MeEncoderMotor::begin | ( |  | ) |

Function
  begin

Description
  Initialize Encoder Motor.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ getCurrentPosition()

float MeEncoderMotor::getCurrentPosition | ( |  | ) |

Function
  getCurrentPosition

Description
  The current position of Motor.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ getCurrentSpeed()

float MeEncoderMotor::getCurrentSpeed | ( |  | ) |

Function
  getCurrentSpeed

Description
  The current speed of Motor's movement.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ move()

boolean MeEncoderMotor::move | ( | float | angle,
|  | float | speed
| ) |  |

Function
  move

Description
  Motor move.

Parameters

  [in] | angle | - The angle move of Motor.
  [in] | speed | - The speed move of Motor.

Output
  None

Return
  Return the result of Motor's movement.

Others
  None

## ◆ moveTo()

boolean MeEncoderMotor::moveTo | ( | float | angle,
|  | float | speed
| ) |  |

Function
  moveTo

Description
  Motor move to the aim.

Parameters

  [in] | angle | - The angle move of Motor.
  [in] | speed | - The speed move of Motor.

Output
  None

Return
  Return the result of Motor's movement to the aim.

Others
  None

## ◆ reset()

boolean MeEncoderMotor::reset | ( |  | ) |

Function
  reset

Description
  Reset the available data for Encoder Motor.

Parameters

  [in] | None |

Output
  None

Returns
  None

Others
  None

## ◆ runSpeed()

boolean MeEncoderMotor::runSpeed | ( | float | speed | ) |

Function
  runSpeed

Description
  The speed of Motor's movement.

Parameters

  [in] | speed | - The speed move of Motor.

Output
  None

Return
  Return 0.

Others
  None

## ◆ runSpeedAndTime()

boolean MeEncoderMotor::runSpeedAndTime | ( | float | speed,
|  | float | time
| ) |  |

Function
  runSpeedAndTime

Description
  The speed and time of Motor's movement.

Parameters

  [in] | speed | - The speed move of Motor.
  [in] | time | - The time move of Motor.

Output
  None

Return
  Return the result of Motor's movement.

Others
  None

## ◆ runTurns()

boolean MeEncoderMotor::runTurns | ( | float | turns,
|  | float | speed
| ) |  |

Function
  runTurns

Description
  Motor move turns.

Parameters

  [in] | turns | - The turns move of Motor.
  [in] | speed | - The speed move of Motor.

Output
  None

Return
  Return the result of Motor's movement.

Others
  None

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

- src/MeEncoderMotor.h
- src/MeEncoderMotor.cpp