![]() |
I need help on a vex code
i am new to programing vex controllers on easy c all i have done is ifi controllers. I need to have one of the buttons on the back of the controller( i'm not really sure what channel they call them) when it is are press to turn X motor at a pwm signal of 170 for 2 seconds. Can anyone help me
|
Re: I need help on a vex code
Quote:
I don't know about EasyC but in the regular C Vex programs, channel 5 has a #define of PWM_in5 and channel 6 of PWM_in6. (Or you could use the raw declarations in the rxdata structure, rxdata.oi_analog05 and rxdata.oi_analog06.) The sample code has defines for BUTTON_FWD_THRESH as 154 and BUTTON_REV_THRESH as 100 to give some leeway in testing whether the buttons have been pressed which seems to imply the values of 0 and 255 might not be firm but the little testing I've done that's what I got. Once you determine the button has been pressed, handle it just like one of the joystick buttons on the FRC operator interface. Just remember the basic control loop on the Vex executes at 18.5 milliseconds rather then the FRC rate of 26.2 milliseconds. |
Re: I need help on a vex code
1 Attachment(s)
A just wrote this in EsayC pro. It assigns motor 1 a value of 255 for 2000ms, and then assigns motor 1 a value of 127.
I haven't tested it since I don't have a Vex hear me, but it should work. You should be able to modify the code to work with multiple motors/switchs. The EasyC pro files are attached. EDIT: If you have any questions PM or e-mail me. |
| All times are GMT -5. The time now is 00:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi