![]() |
Basic Question
We're running EasyC pro for our FRC robot and trying to learn the program.
We were wondering, first, what exactly is "auxiliary analog". It's the 4th option for an axis when you are manipulating something like OI to PWM. Is there a map for the joystick they give us? What are all the buttons called? Also, how would I assign a value 0...255 to a button on the actual joystick, for example, the trigger. Lets say I wanted the trigger to make the motor attached to PWM number 1 run at 200 when it's pressed. How is that done? Thanks a lot, 1182 |
Re: Basic Question
Code:
if (trigger == CLOSED) |
Re: Basic Question
Thanks Tom. We understand the logic behind it but we don't actually know how to implement the trigger in easyC. If you could give us a dumbed down version that would be great.
if (trigger == CLOSED) pwmXX = 200; else pwmXX = 127; ^^ What function block (those things at the left of the screen that you drag in), i.e. "OI to PWM" lets me do that. We know what you mean in logic but what type of variables should "trigger" be set to. Our problem is our lack of experience with EasyC, not with the logic. We just don't know how to implement it into EasyC Pro. Thanks a lot |
Re: Basic Question
In order to set a value to 200 to a motor in port 1 when a button is pressed, You need to do the following: do a while loop that never ends:
Code:
while(1)Now it should work:) *could be that buttonStatus needs to be equal to 1 at the beginning and the while condition to !=1. There is another, more better way to do it: Do a while(1) loop, in it put the OI to PWM function from the RC_Control function blocks, and in the joystick port enter the joystick port, in the axis put the y axis (number 2) and in the PWM# put 1 (the PWM port). Now you can use your motor with the analog joystick (the motor has to be connected to a victor in order to set different speeds). Hope I helped you:) |
Re: Basic Question
Thanks a lot to both of you. It worked.
Peace Wompas |
| All times are GMT -5. The time now is 04:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi