Quote:
|
Originally Posted by Culvan Van Li
I'm new to the VEX system. I've searched through the forums but I haven't found what I'm looking for. I'm programming the VEX kit using MPLAB. I'm trying to build a personal project using a VEX kit. I'd like the robot operate autonomously unless the RC is turned on. When it detects a good signal from the RC I'd like it to come out of autonomous mode so it can be controlled by the RC.
Is there any easy way to do this? I know that "txdata.user_cmd = 0x02;" enables autonomous mode and disables the RC.
I've noticed that VEX has a light to indicate when it has a good signal from the RC. Does anyone know how to detect a good RC signal in software?
|
If you are not using one of the channels on the Transmitter to control the robot, offset the trim on that channel, so that the neutral band on that channel is somewhere in the 90s or 160s on the 0-255 PWM scale. Then in the code, program in that if it ever sees a signal coming from that specific channel in the same range where you offset the trim, you know the Transmitter must be on. (Otherwise, everything defaults to 127.)