isaac879 / Pan-Tilt-Mount

A stepper motor driven, 3D printed and Arduino controlled pan/tilt mount.
MIT License
377 stars 99 forks source link

Scale joystick input to maxSpeed #12

Closed cbradburne closed 3 years ago

cbradburne commented 3 years ago

Currently the joystick sets the motor speed directly (-255 , 255) which moves the axis quite slowly. May I suggest scaling the joystick input to the set maxSpeed?

At line 985 of panTiltMount.cpp: sliderStepSpeed = (sliderStepSpeed * (stepper_slider.maxSpeed() / 255)); panStepSpeed = (panStepSpeed * (stepper_pan.maxSpeed() / 255)); tiltStepSpeed = (tiltStepSpeed * (stepper_tilt.maxSpeed() / 255));

I'd issue a pull request but I'm not 100% on how to do that correctly! :)