|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
!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 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |