|
Re: Help with joystick
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.
|