Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Digital inputs in autonomous mode? (http://www.chiefdelphi.com/forums/showthread.php?t=44166)

Calvin 17-02-2006 03:01

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

Re: Digital inputs in autonomous mode?
 
Quote:

Originally Posted by Calvin
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:
Code:

if (autonomous_mode || p2_sw_top)
and open user_routines_fast.c and change line 105 to:
Code:

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

Re: Digital inputs in autonomous mode?
 
Make sure to remove that before competition, you don't need your drivers accidentally enabling autonomous :)

CarpeDiem 17-02-2006 14:40

Re: Digital inputs in autonomous mode?
 
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.

Jake M 17-02-2006 21:50

Re: Digital inputs in autonomous 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

Ryan M. 18-02-2006 07:46

Re: Digital inputs in autonomous mode?
 
Quote:

Originally Posted by CarpeDiem
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

Re: Digital inputs in autonomous mode?
 
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

Re: Digital inputs in autonomous mode?
 
Quote:

Originally Posted by steven114
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

Re: Digital inputs in autonomous mode?
 
If you accidentally touch the wrong pin, say a +5 to GND, it would prevent you from frying the chip. (for example)


All times are GMT -5. The time now is 18:02.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi