Function Dir
Forums:
Hello,
im working on a project where i control 3 stepper motors using raspberry and picoborgreverse, i was modifying the basic program that comes with the library for controlling a singol stepper motor but i encountered a problem, because i want to control all the three motors at once im having a problem with the function "dir" wich gives the direction of spin to the motor basically having 2+ motor when i run my cycle if one motor has a positive spin and the other a negative they will move all positive because the function dir can't have at the same time the value 1 and -1, so i was wondering if there was another function that works the same but has different name like a dir2,dir3 ecc .
Thanks in advance !
piborg
Tue, 01/24/2017 - 17:10
Permalink
Multiple dir variables
The
dir
value in theMoveStep
function is not actually a function, just a variable which either holds the value-1
or1
.What you can do is copy the section of code which sets what the value is:
and create another copy based on a different value: