Skip to content

Commit

Permalink
Merge branch 'hotfix/ambigous-overloaded'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurb9 committed Jul 24, 2016
2 parents 995bc11 + 6fc8e6c commit dee87aa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/BasicStepperDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void BasicStepperDriver::setDirection(int direction){
* Move the motor a given number of steps.
* positive to move forward, negative to reverse
*/
int BasicStepperDriver::move(long steps){
void BasicStepperDriver::move(long steps){
if (steps >= 0){
setDirection(1);
} else {
Expand All @@ -106,18 +106,18 @@ int BasicStepperDriver::move(long steps){
/*
* Move the motor a given number of degrees (1-360)
*/
int BasicStepperDriver::rotate(long deg){
void BasicStepperDriver::rotate(long deg){
long steps = deg * motor_steps * (long)microsteps / 360;
return move(steps);
move(steps);
}
/*
* Move the motor with sub-degree precision.
* Note that using this function even once will add 1K to your program size
* due to inclusion of float support.
*/
int BasicStepperDriver::rotate(double deg){
void BasicStepperDriver::rotate(double deg){
long steps = deg * motor_steps * microsteps / 360;
return move(steps);
move(steps);
}

/*
Expand Down
9 changes: 6 additions & 3 deletions src/BasicStepperDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ class BasicStepperDriver {
* Move the motor a given number of steps.
* positive to move forward, negative to reverse
*/
int move(long steps);
void move(long steps);
/*
* Rotate the motor a given number of degrees (1-360)
*/
int rotate(long deg);
void rotate(long deg);
inline void rotate(int deg){
rotate((long)deg);
};
/*
* Rotate using a float or double for increased movement precision.
*/
int rotate(double deg);
void rotate(double deg);
/*
* Set target motor RPM (1-200 is a reasonable range)
*/
Expand Down

0 comments on commit dee87aa

Please sign in to comment.