![]() |
Autonomous Switching
Is there anyway a team can switch from a couple of autonomous without reprogramming ie. dipswitch possible with different wiring at all?
Thanks in advance :confused: |
Re: Autonomous Switching
Quote:
For example: Code:
if (rc_dig_in01 == 1) // Can use a simple jumper to pick the autonomous to use |
Re: Autonomous Switching
Quote:
Another thing you can do is if between the modes you just want to change one variable (ie a delay before the code executes) you can use a pot(potentiometer) connected to an analog input and then tie the input from the pot to a variable in your code. If you have any other questions just ask. |
Re: Autonomous Switching
would anybody happen to know how to make a jumper for the FRC robot controller? like, do we jump from ground to signal?
|
Re: Autonomous Switching
Quote:
The Vex tournaments are restricted to jumpers, but FRC is not. |
Re: Autonomous Switching
Quote:
|
Re: Autonomous Switching
What we've been doing is putting a potentiometer on the Operator Interface, marking positions on it... and using it for autonomous selection. Even though your robot is disabled at the beginning of a match, it still reads what value the potentiometer is sending. This allows for unlimited autonomous modes.
The code is just saying that if the value is 0-50, then do one autonomous, and if it is between 50-100 do another, etc. or whatever values you want based on how many auto modes you have. |
Re: Autonomous Switching
Cody,
I think that you are confusing FRC and FVC... Mike Yolande, Just use the orange jumpers that came in your VEX kit... Mike |
Re: Autonomous Switching
You cannot use a potentiometer in Vex. There are none in the vex kits, so any other pot you get would not be a legal Vex part for competition. You can use the Orange jumpers like the previous post suggested. If you've misplaced these, you can use a limit switch with a rubber band or cable tie holding down the switch.
|
Re: Autonomous Switching
Just use the jumpers and it's very trivial. If your microcontroller is in a relatively difficult to reach place, I suggest running some PWM extension cables so you can plug the jumpers in wherever is most convenient.
|
Re: Autonomous Switching
Sorry for the tedious n00bie questions -- I'm not a programmer.
From your code below, I'm assuming that you use the digital input from one of the 16 analog/digital ports to store in your variable. If we want to use Ports #1 & 2 (easiest to distinguish in a hurry), I'm assuming that we would have to reconfigure these as digital inputs. Are there any caveats/disadvantages to doing this, as opposed to using ports #11-16 (already configured as digital inputs by default)? Does your variable rc_dig_in01 have to be declared anywhere prior using it to store the results of your digital input? If we want to read a jumper in the interrupt ports instead, what command do we use to access the input from them? Quote:
Quote:
|
Re: Autonomous Switching
Quote:
You can safely change the default configurations of inputs 1 & 2 to use those for jumpers. With MPLAB You have to change: Set_Number_of_Analog_Channels(NO_ANALOGS); The only issue that might change your mind is if you wanted to use an input for an analog sensor rather than digital. The way the Vex controller is designed any analog inputs you use are declared in order before your digital inputs. If you use MPLAB to program your robot then rc_dig_in01 is defined. In EasyC you'd drag in "Digital Inputs" from under "Inputs" to check your jumper. |
| All times are GMT -5. The time now is 22:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi