View Full Version : Digital inputs in autonomous mode?
I've noticed that we have pwm and relay set to 127 and 0... but nothing set for digital, will digital inputs work during the autonomous?
I mean can I go ahead and say:
if(!rc_dig_in12)
{
DestoryPlanetEarth();
}
Also, one more question: I don't have a switch box built for the Competition port... yet... Is there a way I can enable the autonomous mode through a button on a joystick?
Thank you for your help in advance! :)
aaronm_k
17-02-2006, 06:37
I've noticed that we have pwm and relay set to 127 and 0... but nothing set for digital, will digital inputs work during the autonomous?
I mean can I go ahead and say:
if(!rc_dig_in12)
{
DestoryPlanetEarth();
}
Also, one more question: I don't have a switch box built for the Competition port... yet... Is there a way I can enable the autonomous mode through a button on a joystick?
Thank you for your help in advance! :)
Digital controller inputs (such as rc_dig_in12) will work in autonomous mode, as they are plugged directly into the RC. Digital OI inputs, on the other hand, will not work as the OI is disabled during autonomous mode.
If you want to simulate autonomous mode using a joystick button, open main.c and change line 52 to:
if (autonomous_mode || p2_sw_top)
and open user_routines_fast.c and change line 105 to:
while (autonomous_mode || p2_sw_top)
where p2_sw_top is the joystick button you want to use.
Matt Krass
17-02-2006, 14:10
Make sure to remove that before competition, you don't need your drivers accidentally enabling autonomous :)
CarpeDiem
17-02-2006, 14:40
If you dont have the box built for entering auto then you can just turn the theam number to 1 i think to enter auto mode.
You could just take a small piece of wire, strip the ends, and connect the auto and ground pins. I forget which is which, but it is in the manual
If you dont have the box built for entering auto then you can just turn the theam number to 1 i think to enter auto mode.0, actually. But yeah, that'll work.
steven114
18-02-2006, 13:04
Because the competition port pins are hooked directly up to the PIC inside, IFI recommends (in one of their documents, forget which) that instead of hooking your wires directly to the port, you should insert a resistor on one leg. Sounds like good advice to me...
Windward
18-02-2006, 13:13
Because the competition port pins are hooked directly up to the PIC inside, IFI recommends (in one of their documents, forget which) that instead of hooking your wires directly to the port, you should insert a resistor on one leg. Sounds like good advice to me...
What would that do? We just have them connected.
steven114
18-02-2006, 13:16
If you accidentally touch the wrong pin, say a +5 to GND, it would prevent you from frying the chip. (for example)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.