Go to Post everyone here has a life outside of FIRST (some just don't want to admit it). - shyra1353 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-02-2008, 19:18
Amisca Amisca is offline
Registered User
FRC #0538
 
Join Date: Jan 2006
Location: Alabama
Posts: 15
Amisca is an unknown quantity at this point
IR Programming

I have to IR Board wired up to digital ins 1-4. I understand that I am supposed to use those inputs in the code, but I have tried alot of things and it seems like everytime it just doesnt do as I intend. I have seen some of the sample code posted here before, but it was in the user_routines.c and not user_routines_fast.c as I would expect. Can anyone help me please?
  #2   Spotlight this post!  
Unread 14-02-2008, 19:28
Chris1228 Chris1228 is offline
Registered User
FRC #1228
 
Join Date: Sep 2007
Location: Rahway, NJ
Posts: 22
Chris1228 will become famous soon enough
Re: IR Programming

I got it to work with easyC
  #3   Spotlight this post!  
Unread 14-02-2008, 19:30
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: IR Programming

Prior to the start of the hybrid period, the robot is disabled
and is running through the packet handling loop that is normally
used for the operator controlled period. During this time you
might receive the IR commands and set a state variable
to the values 1, 2, 3, or 4, based on the last command seen.
During the hybrid period, the robot will be controlled by the
"autonomous" packet loop, and you might execute one of four
plays based on the value of this state variable. The total number
of plays might be greater, selected by other switches on the robot
that are set when the robot is set in its starting position, but you
can only select one of four plays with the IR commander after
the balls are placed and these plays must be posted.

An alternative approach is to establish some limited remote control
of the robot using four available actions, coded entirely in the autonomous
code, subject to the applicable rules.
  #4   Spotlight this post!  
Unread 15-02-2008, 16:25
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Re: IR Programming

Amicsa,

What exactly are you trying to do?

A couple of things:

Whatever you plug the IR board into must be configured as an INPUT; otherwise it will always read 0.
If the IR board is not plugged in, you'll get all 1s for the inputs, so you need to check for that as well.
If you want it to do something in hybrid mode, it does need to go in the user_routines_fast.c file, in the user_autonomous method (or else it's called something similar to that - I'm using WPILIB and so don't remember exactly).

Depending on what you do with them, you'll want to write code for each input.

Code:
[indent]if(rc_dig_in01){
do_stuff_01();
}//end if[indent]else if(rc_dig_in02){
do_stuff_02();
}//end if[indent]else if(rc_dig_in03){
do_stuff_03();
}//end if
else if(rc_dig_in04){
do_stuff_04();
}//end if
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming in Python and Explaination of Programming roboxking Programming 22 07-01-2008 16:08
Programming AM brennerator Programming 0 10-02-2007 14:20
programming motors with programming kit BorisTheBlade FIRST Tech Challenge 4 01-11-2005 19:03
programming great_one411 General Forum 1 14-02-2003 11:28
Programming archiver 2000 6 23-06-2002 22:55


All times are GMT -5. The time now is 00:57.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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