basic phidget stepper motor support for slider and buttons #1715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I added basic commands to control a phidget (bipolar-) stepper motor via a slider or button action.
I copied the structure of the phidget RC servo implementation.
Currently there are 3 commands:
rescale(ch,val[,sn]) - used to set the rescale factor
engaged(ch,state[,sn]) - used to engage the channel
set(ch,pos[,sn]) - used to set the target position
The (scale) 'Factor' in the Events-window can be used to decide the direction (-1 for counter-/ 1 for clockwise).
In combination with the 3 commands and the min/ max of the slider there are many ways to control the stepper motor.
The rescale factor can be used to make 1 step = 1° or 1 step = rotation, etc.
So setting the min=0, max=100 and factor=-3.6 in combination with the right rescale factor gives a rotation in [0,-360°] where each step is equal to -3.6°.