Quote:
|
Originally Posted by deltacoder1020
just a cautionary real-world note, although this may work for the FRC, in actual C, the value of "true" for booleans is not always 1 - in fact, it's often -1.
but yes, for the FRC, one could use Joe's code.
|
Well, to be accurate, the value of true is not-false, that is, anything but 0. But p1_sw_trig is a bit, representing 1 for on, and 0 for off, so it'll be okay.
Oh, and yall don't know how lucky you have it (well, most of you do). Back in my day, we didn't have your stinkin' order of operations, and had to cram our code full of paretheses. (Or, more accurately, casually forget to do so and hit yourself when you see robot go crazy.) Yet another benefit of C over PBASIC. I, for one, am breathing a sight of relief.