jkjellman
04-26-2007, 05:10 PM
Hello,
I am a professional programmer by trade and work on robotics in my spare time. I wanted to strt using my Vex kits as simply as possible (MPLAB IDE looks great, but there isn't enough documentation to figure out what functions do what from what I've found).
I am trying to build a robot for a local club competition and wanted to have RC control via the RxInput block as well as autonomous control. Whenever I try to use both all the motor ports go crazy and start forwarding and reversing the motors.
I read the help file which stated you couldn't combine RC motor control and autonomous motor control (which makes sense) unless they are in different blocks of code.
As a simple test I made a loop that would first read a channel using RxInput and store that value in a variable on the first pass and then use that variable to set the motor speed on the second pass. Then the loop just keeps repeating. This works if I put a large delay after the if statement (about 250 ms seems to do it) but does not work without the delay or with a shorter delay. This long delay makes steering jerky and unresponsive.
Is there any reason why I cannot use RxInput and still manually set the motor speed and/or servo position?
BTW, I am not using any of the functions that directly link the RC data to a motor or servo as I only want RC control under certain circumstances for the competition.
Any help would be greatly appreciated.
Take care,
KJohn
I am a professional programmer by trade and work on robotics in my spare time. I wanted to strt using my Vex kits as simply as possible (MPLAB IDE looks great, but there isn't enough documentation to figure out what functions do what from what I've found).
I am trying to build a robot for a local club competition and wanted to have RC control via the RxInput block as well as autonomous control. Whenever I try to use both all the motor ports go crazy and start forwarding and reversing the motors.
I read the help file which stated you couldn't combine RC motor control and autonomous motor control (which makes sense) unless they are in different blocks of code.
As a simple test I made a loop that would first read a channel using RxInput and store that value in a variable on the first pass and then use that variable to set the motor speed on the second pass. Then the loop just keeps repeating. This works if I put a large delay after the if statement (about 250 ms seems to do it) but does not work without the delay or with a shorter delay. This long delay makes steering jerky and unresponsive.
Is there any reason why I cannot use RxInput and still manually set the motor speed and/or servo position?
BTW, I am not using any of the functions that directly link the RC data to a motor or servo as I only want RC control under certain circumstances for the competition.
Any help would be greatly appreciated.
Take care,
KJohn