[OCCRA]: Template

We are trying to use the new template required for the vex to program in a push button, we are having difficulty getting this to work in the autonomous part of the template. Are there any tips or advice to help us with this and using the template in general? The problem we think is that when attempting to use the push button to start it always jumps to the else statement. Could someone please post an example on using a push button to start autonomous with this new template?

Unless I am wrong you are NOT required to use the template…

This question will be forwarded to the creator Marc Center.

Mike,
I think you are wrong. I have not personally used the template before, however, FTC has used similar templates before. The template allows us to automatically jump from 15 second autonomous (no remote control operation) to remote control operation for the 120 second period.

I imagine that the programming blocks used for remote control operation will
not work in the autonomous program block. Whether you can actually copy and paste them, and then they don’t operate as expected or Easy_C doesn’t even allow you to copy the remote control functions into the autonomous template - I will do some experimentation when I get home.

Can you post your program so I can look at it? You will need to find two files associated with our program, zip them together and then post with your message. At first blush, once autonomous is activated, reading a switch
should operate without much issue. Are you using an IF statement like
(If variable = pressed ) This is always true and the ELSE statement will never be run], rather than the proper statement (IF variable == pressed) Note the double equal sign].

Last year there was no need to use a template because we were running autonomous operation only. With this year’s introduction of remote controlled period, use of the template became meaningful.

To clarify for the 2008 football frenzy for vex, do we or do we not need to use the new template for our Vex programs?

Please download the OCCRA programming Basic workshop (in Microsoft Powerpoint format) held September 13, 2008 contained in this forum. You will find your answer on page 2, item #6. This is the official answer until otherwise notified. Can you upload your code so I can look at what you have programmed so far to see if I see any issues?

P.S. Last night I read in the VEX instructions that the VEX transmitter must be turned on (enabled) in order to
enable autonomous operation with a template. Have you tried adding the receiver module to the robot, enabling
the Transmitter, and the pushing the button to start your program?

Could you please explain how to upload the program so we can post it to you?

pushbuttontrial.zip (208 Bytes)
Our programming for our push button is in the zipped folder that should be posted with this…

pushbuttontrial.zip (208 Bytes)


pushbuttontrial.zip (208 Bytes)

Sorry, the last posted zipped folder does not contain both required folders.
pushbuttontrial.zip (1.42 KB)

pushbuttontrial.zip (1.42 KB)


pushbuttontrial.zip (1.42 KB)

Dear RO Ravens,
Thanks for being brave and posting your question on CD.

Your controller configuration is configured as an analog input for channel 1. You need to change it to a digital input. Will attach powerpoint pdf file showing information. Have you worked your way through the VEX inventors manual?
If you cannot find the VEX manual at your school, you can download it from the VEX website directly. I think you will find the 4 hours you invest in working through the manual extremely beneficial - it would have shown you how to select the digital input for your simple example.

Please let me know if you find any other issues after spending the time going the VEX inventors manual.

We changed the analogue input to digital input and when we downloaded it to the robot, the push button still didn’t work. We’ve been trying to fix this for a while. We’ll repost our program with the input changed.

pushbuttontrial.zip (1.42 KB)


pushbuttontrial.zip (1.42 KB)

This template and pushbutton work on my VEX robot at home. Please try it on yours. You will need to wire the Start Button to digital input 5 in order to make the program work.

Here were the issues I found with your program

  1. Your configuration template still had input one configured as analog and not digital. The default configuration uses input 5 as a digital input. Whatever you are doing will be fixed by wiring a Start push button switch to input position 5.

  2. You did not latch or save the value of the switch. The program runs very fast. Your original program would have run for two seconds after you pressed start switch (only because of your 2000 msec wait loop). On the next loop, once you let off the switch, the program would now read a one (not pressed) and stop the motors. The solution is shown and once the switch reads a zero (0 = pressed), you need to latch or save the value in a variable that is different than just reading the value (which happens in only one place and is very fast). The variable should be initialized as the not pressed state in order to not have the software think that at start up initialization that it has already been pressed.

  3. I added a remote control tank function block in both autonomous and operator control. The tank works only in operator control as expected.

  4. After you program the robot, you always need to cycle the power (turn it off then on). Using the terminal window for debugging, I turned on the robot and quickly pressed the Start Button. Watch the print statements that I have added to help debug the program. The autonomous program starts[Print] , the Start Switch is pressed [Print] and the robot moves forward [Print] (with 800 msec wait loop for print statement) . If you don’t press the Start Switch, you receive another print message in the terminal window (Motor Stop) [Print].

  5. The terminal window will also show when the Autonomous mode is operational (15 seconds), and show when Operator Control Mode becomes active (120 seconds). I watched the terminal window while cycling the power on, and quickly pressing the start switch. I ended up counting 15 print statement messages indicating that the motor was moving forward for the 15 seconds of the autonomous period.

Thank you, and i will take a look at the program and adjust to see if that will work. Now for the OCCRA competition we need to use the template correct? cuz i thought we do but then if so do we need to use the push button to start? Or may we have it start on its own from the template? I know they stressed before about using the push button to start but does that still apply now that we have the template to use? Thank you for your time spent with ur guidance

RO Raven,
Yes. We should still use the start push button inside of the autonomous template for safety reasons. So, the start sequence becomes a three stage sequence: 1) turn on the VEX controller, 2) turn on the VEX transmitter to
activate the autonomous portion of the OCCRA VEX template, 3) press the start switch for the robot to start the autonomous program.

Dear Teams,
If some of you are just opening up your VEX robots and programming them to use the new OCCRA template, please take a look at this program. I have programmed some basic features into both the autonomous and operator controlled sections to provide a starting spot for you.

  1. Autonomous Control and Operator Control operation have print statements to show you how the the software operates - see the terminal window

  2. In order for the OCCRA VEX template to work properly you must use the VEX transmitter and matching receiver module or the tether cable. In this example, you must turn on the Vex transmitter and then hit start button (wired to digital input 5) to start the program.

  3. Digital input 6 has been configured to stop program operation in both autonomous and operator control. You should be able to stop and then restart autonomous control (within the 15 second window). You cannot restart operator control as written.

  4. This may become the starting OCCRA VEX template for 2009. Please email me if you are successful with using this program.

Thanks,

Teams,
Here is an enhanced version of V1, OCCRA_2008_V2, that includes the use of a Timer to allow you to see, in time, when:

  1. Autonomous starts

  2. After VEX transmitter is turned on, Press Start Button

  3. As autonomous runs

  4. If stop is pressed during autonomous, see the time

  5. If run is pressed again, after stop, in autonomous, see the time

  6. Operator control time start and run

  7. Time if stop switch is pressed in operator control mode

Please remember that after downloading a new program using the base 2008 OCCRA template that you need to cycle (turn off, turn on) the power to
the VEX microcontroller in order for it to start the program you have just
downloaded.

Cheers, Go OCCRA Teams!