Makeblock-library-for-Arduino  V3.2.4
It's a library for arduino application developers
Public Member Functions | Protected Member Functions | List of all members
MeStepper Class Reference

Driver for Me Stepper device. More...

#include <MeStepper.h>

Inheritance diagram for MeStepper:
MePort

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

void MeStepper::computeNewSpeed ( )
protected
Function
computeNewSpeed
Description
Compute New Speed of Stepper.
Parameters
[in]None
Output
None
Return
None
Others
None
long MeStepper::currentPosition ( void  )
Function
currentPosition
Description
Stepper's current position.
Parameters
[in]None
Output
None
Return
Return the current position of Stepper.
Others
None
void MeStepper::disableOutputs ( )
long MeStepper::distanceToGo ( void  )
Function
distanceToGo
Description
The distance that Stepper should go.
Parameters
[in]None
Output
None
Return
Return the length of Stepper's running.
Others
None
void MeStepper::enableOutputs ( )
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
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
boolean MeStepper::run ( void  )
Function
run
Description
Stepper's status-—run or not.
Parameters
[in]None
Output
None
Return
Return the status.
Others
None
boolean MeStepper::runSpeed ( void  )
Function
runSpeed
Description
The speed of Stepper's running.
Parameters
[in]None
Output
None
Return
Return true or false.
Others
None
boolean MeStepper::runSpeedToPosition ( void  )
Function
runSpeedToPosition
Description
The speed of Stepper on the way to position.
Parameters
[in]None
Output
None
Return
Return true or false.
Others
None
void MeStepper::runToNewPosition ( long  position)
Function
runToNewPosition
Description
The Stepper runs to new position.
Parameters
[in]None
Output
None
Return
None
Others
None
void MeStepper::runToPosition ( void  )
Function
runToPosition
Description
Stepper runs to position.
Parameters
[in]None
Output
None
Return
None
Others
None
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
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
void MeStepper::setMaxSpeed ( float  speed)
Function
setMaxSpeed
Description
Set Max Speed for Stepper.
Parameters
[in]None
Output
None
Return
None
Others
None
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
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
float MeStepper::speed ( void  )
Function
speed
Description
The Speed of Stepper.
Parameters
[in]None
Output
None
Return
Return the Stepper's speed.
Others
None
void MeStepper::step ( )
protectedvirtual
Function
step
Description
Stepper runs step by step.
Parameters
[in]None
Output
None
Return
None
Others
None
long MeStepper::targetPosition ( void  )
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: