|
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.
|