View Single Post
  #6   Spotlight this post!  
Unread 24-03-2004, 10:38
10intheCrunch's Avatar
10intheCrunch 10intheCrunch is offline
Who's John V-Neun?
AKA: Alex Baxter
None #0254 (Cheesy Poofs)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 129
10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough
Send a message via AIM to 10intheCrunch
Re: digital input question...

I'm pretty sure you can, if they are set up in a struct together. Say:

if(SomeStructbits.bit0) blah;

If you only want to see the first bit of any variable, though, use modulus.

if(someVar % 2) morestufftodo;

If you aren't familiar with modulus, it gives the remainder of dividing by the number you mod by, ie modding by 2 gives you one or zero depending on if the number is even or odd (or rather, if the first bit is 1 or 0).

Good luck.
__________________
~Alex Baxter
Programming, Arms operation, Team 254