Go to Post Just get a nice big box of maraschino cherries and a cup of coffee and settle yourself down for a fun read. You'll be amazed at the ideas that you are going to have pop into your head. - JaneYoung [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 02-11-2006, 03:33
cdennisxlx2's Avatar
cdennisxlx2 cdennisxlx2 is offline
Team San Diego Web Liaison
AKA: Cameron Dennis
FRC #1266 (The Devil Duckies)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: San Diego
Posts: 188
cdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to beholdcdennisxlx2 is a splendid one to behold
!HELP! IM STUCK IN A SUBROUTINE!!! !HELP!

Im developing a set of subroutines to make it easyer for my teams programmers. But when i tried to show them how to call them it calls the first one and stays.

example: From user_routines_fast.c

This is the autonomous code i made to test calling subroutines [line: 141]
Code:
/*******Autonomy Notes*********************
* "time" was initalized on line 24
* relay1_fwd/rev = Bottom Cylinder
* relay3_fwd/rev = Top Cylinder
*	    pwm01 = Left Drive motor
*           pwm02 = Right Drive motor
*           pwm03 = Shooter
*           pwm04 = Tilt
*	  26 loops = One Second (roughly)
****************************************/		
                 
if (time >= 0 && time < 50)
{	
	Left();
}
else if (time > 50 && time < 100)
{
	Stop();
}
else if (time > 100 && time < 150)
{ 
	Right();
}
else if (time > 150)
{
	pwm01 = pwm02 = 127;
}
time++;  //Incriment time

These are the subroutines [line: 290 in user_routines_fast.c]
Code:
unsigned char Left()
{
	pwm01 = 0;
	pwm02 = 254;
	return 0;	
}

unsigned char Right()
{
	pwm01 = 254;
	pwm02 = 0;
	return 0;	
}

unsigned char Stop()
{
	pwm01 = pwm02 = 127;
	return 0;
}

The FUNCTION PROTOTYPES for the subroutines in user_routines.h
Code:
unsigned char Left(void);
unsigned char Right(void);
unsigned char Stop(void);

Can anyone tell me why when i run this it stays in Left()??????????


thank you in advanced
__________________
Team San Diego Robotics Web Liaison
Webmaster and Technical Advisor for the San Diego Regional Planning Committee.
Official Score Keeper for the San Diego Regional
www.sandiegoregional.com
www.frc1266.com
 


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
RC Controller Stuck bhk88 Programming 1 31-01-2006 17:46
Stuck on Camera Mount busterblade16 Programming 2 14-02-2005 22:07
stuck in programming mode Shu Song Control System 2 29-04-2004 16:44
help! Am really stuck!!!! pagemauck Programming 8 29-01-2004 12:38
guy stuck in toilet! robot180 Chit-Chat 8 14-11-2003 22:27


All times are GMT -5. The time now is 23:32.

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