MakeBlock Drive Updated Updated library for MakeBlock Ranger

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

Driver for Me Stepper device. More...

`#include <src/MeStepper.h>`

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

## Public Member Functions
| MeStepper ()
| MeStepper (uint8_t port)
void | setpin (uint8_t dir_data, uint8_t step_data)
void | moveTo (long absolute)
void | move (long relative)
boolean | run ()
boolean | runSpeed ()
void | setMaxSpeed (float speed)
void | setAcceleration (float acceleration)
void | setSpeed (float speed)
float | speed ()
long | distanceToGo ()
long | targetPosition ()
long | currentPosition ()
void | setCurrentPosition (long position)
void | runToPosition ()
boolean | runSpeedToPosition ()
void | runToNewPosition (long position)
void | disableOutputs ()
void | enableOutputs ()
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)

## Protected Member Functions
void | computeNewSpeed ()
virtual void | step ()

## 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 Stepper device.

Class: MeStepper

Description
  Declaration of Class MeStepper.

Copyright (C), 2012-2016, MakeBlock

## Constructor & Destructor Documentation

## ◆ MeStepper() [1/2]

MeStepper::MeStepper | ( |  | ) |

Alternate Constructor which can call your own function to map the stepper to arduino port, no pins are used or initialized here.

Parameters

  [in] | None |

## ◆ MeStepper() [2/2]

MeStepper::MeStepper | ( | uint8_t | port | ) |

Alternate Constructor which can call your own function to map the stepper 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

## ◆ computeNewSpeed()

void MeStepper::computeNewSpeed | ( |  | ) |
| protected

Function
  computeNewSpeed

Description
  Compute New Speed of Stepper.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ currentPosition()

long MeStepper::currentPosition | ( |  | ) |

Function
  currentPosition

Description
  Stepper's current position.

Parameters

  [in] | None |

Output
  None

Return
  Return the current position of Stepper.

Others
  None

## ◆ distanceToGo()

long MeStepper::distanceToGo | ( |  | ) |

Function
  distanceToGo

Description
  The distance that Stepper should go.

Parameters

  [in] | None |

Output
  None

Return
  Return the length of Stepper's running.

Others
  None

## ◆ move()

void MeStepper::move | ( | long | relative | ) |

Function
  move

Description
  Stepper moves to the aim.

Parameters

  [in] | relative | - The relative length to Stepper's movement.

Output
  None

Return
  None

Others
  None

## ◆ moveTo()

void MeStepper::moveTo | ( | long | absolute | ) |

Function
  moveTo

Description
  Stepper moves to the aim.

Parameters

  [in] | absolute | - The absolute length to Stepper's movement.

Output
  None

Return
  None

Others
  None

## ◆ run()

boolean MeStepper::run | ( |  | ) |

Function
  run

Description
  Stepper's status-—run or not.

Parameters

  [in] | None |

Output
  None

Return
  Return the status.

Others
  None

## ◆ runSpeed()

boolean MeStepper::runSpeed | ( |  | ) |

Function
  runSpeed

Description
  The speed of Stepper's running.

Parameters

  [in] | None |

Output
  None

Return
  Return true or false.

Others
  None

## ◆ runSpeedToPosition()

boolean MeStepper::runSpeedToPosition | ( |  | ) |

Function
  runSpeedToPosition

Description
  The speed of Stepper on the way to position.

Parameters

  [in] | None |

Output
  None

Return
  Return true or false.

Others
  None

## ◆ runToNewPosition()

void MeStepper::runToNewPosition | ( | long | position | ) |

Function
  runToNewPosition

Description
  The Stepper runs to new position.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ runToPosition()

void MeStepper::runToPosition | ( |  | ) |

Function
  runToPosition

Description
  Stepper runs to position.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ setAcceleration()

void MeStepper::setAcceleration | ( | float | acceleration | ) |

Function
  setAcceleration

Description
  Set Acceleration for Stepper.

Parameters

  [in] | acceleration | - The acceleration for Stepper.

Output
  None

Return
  None

Others
  None

## ◆ setCurrentPosition()

void MeStepper::setCurrentPosition | ( | long | position | ) |

Function
  setCurrentPosition

Description
  Set Stepper's current position.

Parameters

  [in] | position | - The current position for Stepper.

Output
  None

Return
  Return the current position of Stepper.

Others
  None

## ◆ setMaxSpeed()

void MeStepper::setMaxSpeed | ( | float | speed | ) |

Function
  setMaxSpeed

Description
  Set Max Speed for Stepper.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ setpin()

void MeStepper::setpin | ( | uint8_t | dir_data,
|  | uint8_t | step_data
| ) |  |

Function
  setpin

Description
  Set pin for Stepper.

Parameters

  [in] | dir_data | - The direction data of Stepper's movement.
  [in] | step_data | - The command data for Stepper.

Output
  None

Return
  None

Others
  None

## ◆ setSpeed()

void MeStepper::setSpeed | ( | float | speed | ) |

Function
  setSpeed

Description
  Set Speed for Stepper.

Parameters

  [in] | speed | - The speed of Stepper.

Output
  None

Return
  None

Others
  None

## ◆ speed()

float MeStepper::speed | ( |  | ) |

Function
  speed

Description
  The Speed of Stepper.

Parameters

  [in] | None |

Output
  None

Return
  Return the Stepper's speed.

Others
  None

## ◆ step()

void MeStepper::step | ( |  | ) |
| protected virtual

Function
  step

Description
  Stepper runs step by step.

Parameters

  [in] | None |

Output
  None

Return
  None

Others
  None

## ◆ targetPosition()

long MeStepper::targetPosition | ( |  | ) |

Function
  targetPosition

Description
  Stepper goes to target position.

Parameters

  [in] | None |

Output
  None

Return
  Return the position of Stepper.

Others
  None

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

- src/MeStepper.h
- src/MeStepper.cpp