Thread: IR Sensor
View Single Post
  #3   Spotlight this post!  
Unread 29-01-2008, 00:14
AdmiralAllen's Avatar
AdmiralAllen AdmiralAllen is offline
Master of Computers and Robots
AKA: Allen Worcester
FRC #1662 (Raptor Force Engineering)
Team Role: Alumni
 
Join Date: May 2006
Rookie Year: 2005
Location: California
Posts: 37
AdmiralAllen will become famous soon enough
Re: IR Sensor

Quote:
Originally Posted by wt200999 View Post
instead of having it do the actual actions when you press the button you can have it set a variable with the button, then it does a certain routine depending on the button pressed. Example:

Code:
unsigned char test;

if(rc_dig_in01)
    test=1;

if(rc_dig_in02)
    test=2;

if(rc_dig_in03)
    test=3;

if(rc_dig_in04)
    test=4;


if(test==1)
   (routine a)

etc
is that code adequte to adjust the variable "test"