Quote:
Originally Posted by Alpha Beta
http://www.chiefdelphi.com/media/papers/2874
In BEGIN you'll see how to start single and double action solenoids as well as how to set-up a 4 motor drive.
In FINISH you'll see how to end each of those things.
In TELEOP we just read the state of our driver controls and write them to global variables. We used button 3 for shifting and button 2 to control our arm moving up and down. We also read the X and Y joystick axis to pass along to our drive loop.
In PERIODIC TASKS/TIMED TASKS you'll find us reading the global variables. The X and Y joystick variables are read in the drive loop. You can ignore the logic involving the "SkySwitch".
When reading the button 3 variable you'll notice some logic used to toggle so the driver doesn't have to keep the button pressed to stay shifted. Ignore the "shift overide" logic. After the toggle we set the state of the solenoid. Single action solenoids are set to either off or on.
Our appendage on button 2 is set up in a similar fashion with a toggle. Again, you can ignore the intermediate logic. You'll notice that the double action solenoid is set to either forward or reverse instead of off or on.
During AUTONOMOUS we write to the same global variables that the driver's controls write to during teleop. If we wanted to lower the appendage we would write button 2 to true which simulates a driver button press. To raise the appendage we have to write it false (simulating the driver releasing the button) than write it true again (switching the output state of the toggle).
|
wow, that is really helpful, thank you.
I read something regarding using global variables and it was saying that using a lot global variables may cause lags on your cRIO. We have FRC cRIO with 8 slots and as far as i know its ram is half of the cRIO with 4 slots. Should we avoid using them or it's not a big problem?
Did you use a custom dashboard to view the speed using encoders? We have encoders on shifters and we don't need them specifically, but we want to use them to view our speed on dashboard.
btw, what is the purpose of using "WPIEnhanced IOSet Ehanced digital config vi", i didn't understand those part in the begin.vi exactly.
Thanks again.