|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Using Custom Inputs on the Controller Board
Hey
I want to use custon imports on the controller board to choose which color the robot should look for. I plan on using 2 switches and using the four possible possitions as four possible options (Yellow, Red, Green, Off) How do I call on these inputs in the code. I figured I would us one of the joystick inputs and use my owm cable, but how do I tell the code where to pull the info from? --Sam --Team 486 --Positronic Panthers |
|
#2
|
||||
|
||||
|
Re: Using Custom Inputs on the Controller Board
Quote:
|
|
#3
|
|||
|
|||
|
Re: Using Custom Inputs on the Controller Board
Keep in mind that while in autonomous mode, the controller will read all switches as off. However, you can read the values before autonomous mode and save them on the robot controller itself to work around this.
|
|
#4
|
||||
|
||||
|
Re: Using Custom Inputs on the Controller Board
Quote:
|
|
#5
|
|||
|
|||
|
Re: Using Custom Inputs on the Controller Board
Sorry, that's what I meant
![]() |
|
#6
|
|||||
|
|||||
|
Re: Using Custom Inputs on the Controller Board
Quote:
|
|
#7
|
|||||
|
|||||
|
Re: Using Custom Inputs on the Controller Board
Unless you put in a specific check, the software doesn't care about enabled vs. disabled. The only difference is whether or not the RC pwm and relay outputs are activated.
Autonomous vs. manual is another story. If you put code in the autonomous section, it will only run if autonomous mode is commanded (by grounding the "autonomous" pin on the competition port). I'm not sure if the auton_mode flag is overriden by the "disable" pin or not. |
|
#8
|
|||
|
|||
|
Re: Using Custom Inputs on the Controller Board
1. The autonomous mode is disabled if the disable pin is grouned. I made a switch which allows us to enable/disable the robot as well as activate autonomous mode. We also made a dongle which allows us to change the channels the robot was using. This came in handy when we participated in a post-season competition and those running it forgot that by default the robots run on the same frequency. I don't know how many people have these, but if anyone wants instructions to make one, just send me a Private Message.
2. I know how to work digital I/O on the RC, its just on the controller board that I don't know how. In ifi_aliases.h it simply defined by a bizzare string (the trigger on the 1st joystick is defined by "rxdata.oi_swA_byte.bitselect.bit0," which comments tell us is the 5th pin on port 4 [sic] plus what I assume is ground. There are only 4 possible digital inputs defined for each port. Is this the maximum? Also, is it possible to have outputs (ie for extra leds, etc)? I know that we are allowed to use computers connected to the dashboard program this year, but is there a more streamlined way? --Sam --Team 486 --Positronic Panthers --http://www.gotrobot.org/ |
|
#9
|
|||||
|
|||||
|
Re: Using Custom Inputs on the Controller Board
Again, Sam, all your questions are answered in the OI documentation (on the IFI web site). Yes, there are four switch inputs on each joystick port. Yes, you can connect LEDs to the LED outputs provided for that purpose on two of the ports.
The "bizarre" string is pointing to a particular bit in the received communication buffer coming from the radio link. That's how the RC gets its data from the OI. Just use the alias and don't worry about the details of why it works. |
|
#10
|
|||||
|
|||||
|
Re: Using Custom Inputs on the Controller Board
Quote:
Specifically, see page 5 and 7-10 of http://www.ifirobotics.com/docs/oi-ref-guide-1-25-05.pdf. “Each port provides four unique digital inputs. PORT 2 provides access to the same digital inputs as PORT 3, allowing access to 8 digital inputs from PORT 2. PORT 4 provides access to the same digital inputs as PORT 1, allowing access to 8 digital inputs from PORT 4.” |
|
#11
|
|||||
|
|||||
|
Re: Using Custom Inputs on the Controller Board
Quote:
(By the way, the default code with camera support already uses the trigger switch on joystick #2 to switch among colors to track.) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help On Coding 2K1 Controller | GregTheGreat | Programming | 9 | 05-12-2003 18:35 |
| serious problem found - robot controller resets when jarred! | KenWittlief | Electrical | 23 | 19-03-2003 13:30 |
| Custom Mod Controller. | Josh Hambright | Electrical | 9 | 17-01-2003 08:05 |