hello! we’re a rookie team for the FIRST robotics competition and we’re using intelitek’s easyC. we got the robot driving, but how do we use the other buttons such as the little joystick on the joystick, the trigger, thumb, and the other two buttons? i’ve tried relay, but i found it to work only on spikes. How do we get it to work on victors? any help would be greatly appreciated, thank you!
You will first have to assign each of the buttons as a digital input. In the browser, expand the RC Control browser. Then drag a Digital OI Input into your program were it can be accessed by the fuction you want it to accomplish. Choose the port that the joystick is plugged into and then choose the button number. 1=Trigger, 2=Thumb, 3=Aux1 (the left button) 4=Aux2 (the right button). As far as I know you can’t use the easyC program to use the little joystick. You will need to make a variable for the digital input to retrieve to. Make the varriable an “unsigned char”. I’m not sure what you want the buttons to do with the motors but the basic idea is to make so that if xxxxxx (your digital inputs variable) = 1 set pwm to yyyyy (the motors speed). NOTE: the buttons read as 1 if they are pressed, if you release them they go back to 0. Hope this helps.
alright!! thanks!! ill try it out tomorrow at school. and does anybody know how to debug on the same line? its the PrintToScreen command but when i try to output 2 variables, its on 2 lines and looks messed up. so does anybody know how to put both on the same line? thanks!