My team has used this technique with great results, and I thought that I would share it with everyone. We all want our robot to be as fast and possible, but precision is also key. We solved this problem by having our robot move at half speed while a certain button is pressed. Here’s the code.
task main(){
int precision = 1;
while true(){
precision = vexRT[Btn6U] ? 2 : 1;
//Sets precision equal to 2 if button 6U is pressed, and 1 if it's not
motor[leftWheel] = vexRT[Ch2] / precision;
motor[rightWheel] = vexRT[Ch2] / precision;
}
}
hah!
nice thats what we did!
we used easyc cortex to program our robot so the code was a lot longer than yours
its the exact same concept though
but now with easyc pro you cant “/2” because the value is from 0 -255 rather than -127 - 127
and we dont have time to figure it out before competition this weekend
maybe for the next one
btw whats your drive ratio?
fast enough that you need a code like that?
Just say: if joystick value is more than 0, divide by 2. Am I not understanding your problem? I don’t know easyC at all, sorry. I like to write everything from scratch by myself
And as to weather you need it, think about a 4 wheel robot powered by just two motors with the driving wheels being 5". If you try and turn to pick up a ring a just little bit to the left at the same speed that you drive, you’re going to overshoot. Or the drivers can carfully nudge the joysticks back and forth, but that wastes a lot of time. I find that the precision button really helps.
thanks!
been thinking about that for a while
but now our vexnet is still glitchy and were scared to reprogram
lets see if i can do it on the bus ride there XD
thanks again for the sample code!
i tried to do this on easyC but i keep getting a syntax error (line 26) http://min.us/jBZaa.bmp
is there something im missing in the “user code” blocks?
i tried the “help” button but that wasn’t any help
thanks
sorry for yet another programming question http://min.us/jTMPA.bmp
i tried “setting” a motor to a particular variable (so i can edit the values later on)
but the variable value “nmotor7” is not getting the Radio input, it is just getting the “0” value in the variable box (i didn’t put value down but it defaults to 0)
therefore the motor just spins continuously
this happened to my main code but i simplified it until this to catch the error
thanks
I tried putting something like in out holonomic drive (or X drive what ever you prefer), but it caused all of the motors to not work when the channel for rotating was added in. Any tips on how to solve this problem?