We need to be able to run a function when we push a button on the controller (trigger, thumb etc.). problem being that we have no clue how to run easy c. thanks!
What you need to do is go into the Operator control function, and from the program flow tab on the left side drag a while loop into the function and put a 1 in the box that comes up this will cause the program to loop until the bot is turned off.
Then drag an if block from the same place and drag it inside the while loop, in the box that comes up type
GetOIDInput([the port you want], [the button number]) == 1
To see what each button number is from the input tab drag OI Digital Input block and the box that comes up will show you what each one is.
What this does is looks if the button is pressed if it is it returns a 1 if not it returns a 0, and the == 1 part looks to see if it is a 1, if it is the code in the if statement will execute otherwise it will skip it, so put whatever you want to have happen when that button is pressed in the if statement.
Here is an example of what the if statement would look like. This one checks if the second joystick trigger is pressed and if it is allows the joysticks to drive the motors.
//Check if user drive
if(GetOIDInput(2, 1)==1)
{
Joystick_Drive();
}
I’m done rambling now:ahh:
Hope this helps
Thanks that really helped alot!!!
whlspacedude