View Single Post
  #1   Spotlight this post!  
Unread 03-01-2007, 21:39
Generalx5's Avatar
Generalx5 Generalx5 is offline
Hard Core Inventor
AKA: Jun(John) Zheng
FRC #1346 (Trobotics)
Team Role: Student
 
Join Date: Nov 2005
Rookie Year: 2004
Location: CANADA
Posts: 94
Generalx5 will become famous soon enough
Unhappy Set Default Digital inputs to Low? How? bad Analog value?

How do I set the digital inputs to low on default? I'm using an optical sensor that inputs voltage when it senses an object, I'm using this on the EDU Mini RC, so is there a solution to setting it low? the sensor doesn't work like a switch so it doesnt short the Sig to Gnd.

Also how do you printf the Analog inputs? I have 3 analog channels and this is how I printf mine:

printf("rc_ana_in01 %3d, rc_ana_in02 %3d, rc_ana_in03 %3d\n",(int)rc_ana_in01,(int)rc_ana_in02,(int)rc_a na_in03),

Is this correct? because im getting readings that look like this:
rc_ana_in01 135, rc_ana_in02 143, rc_ana_in03 151

so please help me out. Thanks!