Go to Post This is a game folks, and rules are rules, even if you kinda sorta broke one rule in the end its still broken - Mike Schroeder [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 02-02-2008, 11:29
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
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
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #2   Spotlight this post!  
Unread 02-02-2008, 11:33
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
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.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #3   Spotlight this post!  
Unread 02-02-2008, 11:47
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
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;
	}
__________________
Eric Haskins KC9JVH
  #4   Spotlight this post!  
Unread 02-02-2008, 12:14
Gamer930's Avatar
Gamer930 Gamer930 is offline
Team 930 and 171 Alumni
AKA: Justin
no team
Team Role: Alumni
 
Join Date: Mar 2002
Rookie Year: 2002
Location: New Berlin, WI
Posts: 388
Gamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to behold
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.
__________________
2010 to Present, Scorekeeper/Field Power Volunteer for FRC/FTC/FLL
2005 - 2010, Team 171 College Mentor
2002 - 2005, Team 930 Student
  #5   Spotlight this post!  
Unread 02-02-2008, 15:30
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
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
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #6   Spotlight this post!  
Unread 02-02-2008, 19:23
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
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;
but you can look that up in p18f8722.h
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -

Last edited by wt200999 : 02-02-2008 at 19:27.
  #7   Spotlight this post!  
Unread 02-02-2008, 22:09
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Sending data from RC to OI

Quote:
Originally Posted by Nathan View Post
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.
Look at the OI Reference Guide for the pinout of the joystick ports. Two of the ports have LED output pins that will do exactly what you want. They duplicate the state of eight of the red and green LEDs controlled using the code that EHaskins showed.
  #8   Spotlight this post!  
Unread 03-02-2008, 22:32
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Re: Sending data from RC to OI

Awesome! Thanks guys!!
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
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
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


All times are GMT -5. The time now is 08:16.

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