|
Re: Mapping Buttons to PWMs
If you want to skip the if statement, you can use the following code
pwm03 = 127 + 63 * p1_sw_trig;
If you want your motor to be able to go backwards also, you can use 2 switches with the following code.
pwm03 = 127 + (63 * p1_sw_trig) - (63 * p1_sw_top);
|