Go to Post I volunteered to be the person responsible for the electronics and raised my hand before realizing that I have had almost no electronics experience. I hope our robot turns out alright... - Blue_Mist [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-01-2008, 20:25
drewjones13's Avatar
drewjones13 drewjones13 is offline
Registered User
no team
Team Role: College Student
 
Join Date: Jan 2007
Rookie Year: 2006
Location: CA
Posts: 13
drewjones13 is an unknown quantity at this point
Exclamation HELP!!! STUCK WITH SUB ROUTINES WITH THE IR!!!

we are having issues with our IR coding in hybrid mode, below is what we have set up, for some reason its only running the first subroutine as if rc_dig_in10 is already initialized to "on" at the start of the code.

Auton Code:

Code:
  
time1 = time1 + 1;
if (time1 <= 5)
{
	rc_dig_in10 = rc_dig_in11 = rc_dig_in12 = rc_dig_in13 = 0;
	pwm01 = pwm02 = 127;
}
else if (rc_dig_in10 = 1)
{
	cmd0();
}
else if (rc_dig_in11 = 1)
{
	cmd1();
}
else if (rc_dig_in12 = 1)
{
	cmd2();
}
else if (rc_dig_in13 = 1)
{
	cmd3();
}
else
{
	rc_dig_in10 = rc_dig_in11 = rc_dig_in12 = rc_dig_in13 = 0;
	pwm01 = pwm02 = 127;
}
Subroutines:

Code:
unsigned char cmd0()
{
	pwm01 = 190;
	pwm02 = 190;
	return 0;	
}
unsigned char cmd1()
{
	pwm01 = 64;
	pwm02 = 64;
	return 0;	
}
unsigned char cmd2()
{
	pwm01 = 190;
	pwm02 = 64;
	return 0;	
}
unsigned char cmd3()
{
	pwm01 = 64;
	pwm02 = 190;
	return 0;	
}

Last edited by drewjones13 : 17-01-2008 at 20:35. Reason: Needed code blocks
 


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
Out with the match list printouts, in with... Pat Fairbank General Forum 19 07-02-2005 20:15
need help with the ir tinderfitles Programming 3 03-02-2004 15:31
Help with the balls! tchescow Kit & Additional Hardware 11 20-01-2004 10:52
Help with the storyboard. LizJJury 3D Animation and Competition 11 13-01-2003 08:37
Help with the gyro chip Team852 Electrical 1 10-01-2003 22:31


All times are GMT -5. The time now is 11:07.

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