|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
i had a student telling me what directions the wheels were turning and i took his word for it instead of double checking, but thank you all for the help
|
|
#2
|
||||
|
||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
I still think we need to see the rest of the code, or at least how the time variable is defined. If it isn't defined static, the variable will be re-initialized everytime its host entity is restarted. So if it's at the top of your function, and this function runs over and over every loop, it will be reinitialized every loop to 0, no matter how much you increment it. Or, time can be a global and it will retain its value, but if you're assigning 0 to it every loop that will also ruin your day. I think you have a pretty simple (and somewhat hard to notice) problem that I'm unfortunately very familiar with, as Mark McLeod can tell you, how many times did I hit Chris with the robot again?
![]() |
|
#3
|
||||
|
||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
the .c file is attached above, but i know for a fact thats not the problem because ive defined "time" and incrimented it the same way for 3 years now and i have had no problem with that at all.
|
|
#4
|
|||||
|
|||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
|
|
#5
|
||||
|
||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
|
|
#6
|
||||
|
||||
|
Re: !HELP! IM STUCK IN A SUBROUTINE!!! !HELP!
Quote:
As far as what I meant, I meant that a local variable inside of a function would be reset everytime the function ended and started again. Not sure why I worded it that way, let me just chalk it up to a goofy morning eh? ![]() |
![]() |
| 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 |