View Single Post
  #10   Spotlight this post!  
Unread 10-02-2004, 11:11
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
Re: Mapping Buttons to PWMs

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.