Thread: Digital Inputs?
View Single Post
  #5   Spotlight this post!  
Unread 15-02-2009, 01:47
Redneck's Avatar
Redneck Redneck is offline
Hacker Hick
AKA: Jamie (2.0) Moran
FRC #0599 (Robodox)
Team Role: Engineer
 
Join Date: Aug 2004
Rookie Year: 2004
Location: California
Posts: 90
Redneck is just really niceRedneck is just really niceRedneck is just really niceRedneck is just really nice
Send a message via AIM to Redneck
Re: Digital Inputs?

Quote:
Originally Posted by programMORT11 View Post
how would you do this in C without adding the C++ digitalinput objects? could you cast the UINT32 GetDigitalInput() function results to boolean?
I don't believe so, because C doesn't have a bool data type. Traditionally boolean logic is done in C with integers with 0 for false and 1 for true. It'll still work the same way. If you have
Code:
if(GetDigitalInput()){
    // something
}
it'll work the same way as the C++ bool value.
__________________


Which badges can you claim?