|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Sending data from RC to OI
We'd like to have an LED on our control panel light up if the robot's in a certain state.
Is it possible to send data from the Robot Controller and have it received at the Operator Interface? Thanks, Nathan |
|
#2
|
||||
|
||||
|
Re: Sending data from RC to OI
There are a couple of ways you could do that. First the dashboard port on the side can provide feedback if you are planning on using an external light or something like that. They have the dashboard viewer application that works with that. You would have to look into it a bit more but it could work. If you are using the default code there are a bunch of things on the bottom of user_routines.c that define all of the user lights that are on the OI on the right had side.
|
|
#3
|
||||
|
||||
|
Re: Sending data from RC to OI
This code is from the IFI code.
Code:
if(user_display_mode == 0)
{
// update the "PWM 1" LED
if(p1_y >= 0 && p1_y <= 56)
{ // joystick is in full reverse position
Pwm1_green = 0; // turn PWM1 green LED off
Pwm1_red = 1; // turn PWM1 red LED on
}
else if(p1_y >= 125 && p1_y <= 129)
{ // joystick is in neutral position
Pwm1_green = 1; // turn PWM1 green LED on
Pwm1_red = 1; // turn PWM1 red LED on
}
else if(p1_y >= 216 && p1_y <= 255)
{ // joystick is in full forward position
Pwm1_green = 1; // turn PWM1 green LED on
Pwm1_red = 0; // turn PWM1 red LED off
}
else
{ // in either forward or reverse position
Pwm1_green = 0; // turn PWM1 green LED off
Pwm1_red = 0; // turn PWM1 red LED off
}
// update the "PWM 2" LED
if(p2_y >= 0 && p2_y <= 56)
{ // joystick is in full reverse position
Pwm2_green = 0; // turn pwm2 green LED off
Pwm2_red = 1; // turn pwm2 red LED on
}
else if(p2_y >= 125 && p2_y <= 129)
{ // joystick is in neutral position
Pwm2_green = 1; // turn PWM2 green LED on
Pwm2_red = 1; // turn PWM2 red LED on
}
else if(p2_y >= 216 && p2_y <= 255)
{ // joystick is in full forward position
Pwm2_green = 1; // turn PWM2 green LED on
Pwm2_red = 0; // turn PWM2 red LED off
}
else
{ // in either forward or reverse position
Pwm2_green = 0; // turn PWM2 green LED off
Pwm2_red = 0; // turn PWM2 red LED off
}
// update the "Relay 1" and "Relay 2" LEDs
Relay1_green = relay1_fwd; // LED is on when Relay 1 is FWD
Relay1_red = relay1_rev; // LED is on when Relay 1 is REV
Relay2_green = relay2_fwd; // LED is on when Relay 2 is FWD
Relay2_red = relay2_rev; // LED is on when Relay 2 is REV
// update the "Switch 1", "Switch 2" and "Switch 3" LEDs
Switch1_LED = !(int)rc_dig_in01;
Switch2_LED = !(int)rc_dig_in02;
Switch3_LED = !(int)rc_dig_in03;
}
else /* User Mode is On - displays data in OI 4-digit display*/
{
User_Mode_byte = backup_voltage * 10;
}
|
|
#4
|
|||||
|
|||||
|
Re: Sending data from RC to OI
If you look on Page 7 and 9 of OI Ref Guide . You can see the pins for the LEDs. Those LEDs coordinate to the code at the bottom of user_routines.c so you will want to modify that.
|
|
#5
|
||||
|
||||
|
Re: Sending data from RC to OI
Now are the examples above for the LEDs on the OI? We wanted to have an external LED that's a couple feet away from the OI controller.
So how do you send stuff to the dashboard port, if that's what we need to do? Thanks, Nathan |
|
#6
|
||||
|
||||
|
Re: Sending data from RC to OI
Yes the example in the default code if for the LEDson the far right side of the OI.The dashboard port is output only. It automatically sends back data at high speeds. Each packet of info is 26 bytes, and is outlined on a datasheet that is included in a zip of the program here: http://ifirobotics.com/dashboard_viewer.shtml In it there are a couple of different things like "USER_BYTE1" or something like that. You can set those in your code I think its just
Code:
user_byte1 = x; Last edited by wt200999 : 02-02-2008 at 19:27. |
|
#7
|
|||||
|
|||||
|
Re: Sending data from RC to OI
Quote:
|
|
#8
|
||||
|
||||
|
Re: Sending data from RC to OI
Awesome! Thanks guys!!
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| trasmitting data from a second camera | iwdu15 | Programming | 1 | 02-02-2007 19:25 |
| Getting data from the robot | mfwit | LabView and Data Acquisition | 1 | 19-02-2006 20:07 |
| Sending data back to the OI | DanDon | Programming | 13 | 26-01-2006 15:17 |
| Sending Data | Raven_Writer | Programming | 8 | 11-09-2003 16:28 |
| REAL DATA from KSC - soap108.com | soap108 | Regional Competitions | 3 | 11-03-2002 08:37 |