Quote:
|
Originally Posted by maxlobovsky
if(p1_sw_some_switch == 1){
pwmxxx=some_value
}
if(p1_sw_some_other_switch == 1) {
pwmxxx=some_other_value
|
You have the general idea, however, the joystick buttons have a value of "0" by default, and switch to "1" when pressed. You may be confusing your test by having the later switch override the first switch test.
Try a simpler test like:
Code:
if (p2_sw_trig)
pwmxxx = 254;
else
pwmxxx = 0;
The 7.2v backup battery powers the PWM center pin.
[edit] Joe Ross beat me to an answer. Hey, Ken W. my typing must be slowing down!
[edit 2] deltacoder corrected my reversal of the joystick button values. (I also get left and right confused). Thanks delta!