RMRobotics / FTC_5421_2014-2015

Assets for 2014-2015 Team 5421 FIRST Tech Challenge.
MIT License
6 stars 1 forks source link

Refactor servo.h library to use scaling power #56

Open jimmyli97 opened 9 years ago

jimmyli97 commented 9 years ago

This should follow in a similar vein to how Motor.h scales power to fit with the minimum/maximum motor power. Basically, after defining a minimum and maximum angle, the function servoSetNonCont should accept any angle value from 0 to 255, and then the function will scale that to the range in between the minimum and the maximum angle.

There is no reason not to do this - this way we only have to define minimum/maximum angles once, and then everything else is relative (which makes it easier to code, as you don't need to add/subtract angles in your head)