|
You could key off of the trigger to indicate the addition or subtraction of a fixed value (1,5,10) to a pwm output.
Initialize to a pwm output of neutral (127). Then, you'll need a direction bit (fwd/rev) so you know whether to add or subtract, and a trigger latch bit so you don't loop through the code a bunch of times, changing the pwm, before you let go of the trigger. You'll also want to min and max (1, 254) so you don't roll over.
|