Quote:
Originally Posted by lukevanoort
I'm surprised it takes that much. In MPLAB, it is just four:
Code:
if(p1_sw_top)
pwm01 = 254;
else
pwm01 = 127;
or five:
Code:
if(p1_sw_top){
pwm01 = 254;
} else {
pwm01 = 127;
}
depending on your coding styles.
|
I can name that tune in one note...I mean, I can write that function in one line:
Code:
pwm01 = p1_sw_top?254:127;
Anyway,
Shivang, if you give some more detail about what you want to accomplish, we can give better advice. Which buttons do you want to use, and what do you want the motors to do when you use them?