Created
February 14, 2015 11:27
-
-
Save 5shekel/1f52bcb8d1f2bad1ee78 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// an alternative to the goStepper2 function from GRslider | |
void goStepper2(int i_dest, int i_velocity){ | |
//takes the various cntrols for the slider stepper2 | |
// and starts to moves the stepper | |
stepper2.enableOutputs(); | |
//velocity between 0-127 | |
//so we map it to ,mybe 10 diffrent values | |
i_velocity = map(i_velocity,0, 127, 0, 10); | |
//then we use this to grab a value from our spd2 array | |
stepper2_Speed = spd2[i_velocity]; | |
stepper2.setMaxSpeed(stepper2_Speed); | |
stepper2.setAcceleration(stepper2_accl); | |
//i refer here to two arrays discrbing the same memebers :/ | |
//i_dest = (sizeof(scalePos)/sizeof(int)) - 1; | |
int tempDest = i_dest - 20; | |
//Serial<<"idest/tempdest>"<<i_dest<<"/"<<tempDest<<endl; | |
stepper2.moveTo(scalePos[tempDest]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment