Quote:
Originally Posted by grampashades
First you guys want:
motor[motorE] = joystick.joy1_y2;
With C programming you set the thing on the left to the value on the right. The other way around shouldn't work. *Unless Robot C built it into the compiler to accept it both ways.
Also as a note to save you guys a lot of frustration later. I would suggets you put in a "dead zone" that stops you from powering the motors with too little voltage.
if ( ( joystick.joy1_y2 < -10) || ( joystick.joy1_y2 > 10))
{
motor[motorE] = joystick.joy1_y2;
}
else
{
motor[motorE] = 0;
}
your motors will thank you.
Second I've found throughout my tetsing that it is much better to program the buttons as such:
if(joy1Btn(1) )
{
code for what you want to happen here
}
else
{
code to make that stop happening
}
While there is not techinical difference in this case....for whatever reason the software gods seem to prefer it without the "==1"
finally, while techinically yes...you could put autonomous code into the "code here" section but you could also run into some serious problems...unless you keep all of your logic sound. You can easliy start getting in trouble when you try things like this.
|
That is beastly awsome, i'm going to test this with our robot when i get our 2nd motor controller.
LAWL I installed Windows 7 on our robotics laptop and all the software still works because it was compatible with Vista.