View Single Post
  #5   Spotlight this post!  
Unread 11-02-2007, 22:53
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: Please help me with this sensor

As you operate the lift, copy the joystick value to the Victor. But when the metal strip is detected by the sensor, copy 127 to the Victor instead, ignoring the joystick.

Now you want to wait awhile for the motor to come to a stop. Create a counter variable. Set it to 3 (if you want to ignore the next 3 times the user_routines function is called). Each time the master processor calls your function, if the counter is not zero, decrement the counter. Only read the joystick after the counter value reaches zero.