and so i figured out the problem (after 2 weeks of gutwrentching testing). It was the code!
it should've been while(TMR2IF=0); rather than ==
:(
[terminate]
Joined: 08 Jan 2006 Posts: 26
Posted: Tue Jan 17, 2006 12:14 am
this is SO strange.
Now it's not working?
Does anyone know? Desperately seeking an answer
(the problem is that the motor isn't running continuously)
newguy
Joined: 24 Jun 2004 Posts: 1911
Posted: Tue Jan 17, 2006 12:34 am
[terminate] wrote:
and so i figured out the problem (after 2 weeks of gutwrentching testing). It was the code!
it should've been while(TMR2IF=0); rather than ==
:(
Wrong.
Code:
while (TMR2IF == 0);
This means "test to see if TMR2IF is equal to zero", and sit in the while loop if it is. In other words, pause at that point until TMR2IF is NOT equal to zero.
Changing it by taking out one of the = now means "make TMR2IF equal to zero" then the while statement tests to see if its argument is true (1). It isn't, because you set it to 0, so it doesn't pause at all.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum