Quote:
|
Originally Posted by Mark McLeod
Any chance you're running out of program/data space?
That's one of the reasons you'll get the yellow light.
Using the .08 value drags in additional s/w to perform floating point processing.
What type is "current.theta" and what's a sample maximum deltat value?
|
Yeah, I think the math is getting a little too big and the Pic can't work with numbers that big. I had the same problem before when I tried to raise a float to the fifth power. What I can't figure out is why the Program State sometimes blinks red. I don't see where I get into an infinite loop.
Current.theta is an unsigned int, and deltat is incremented every 25ms, so generally like 1 or 2. I'm going to try playing around with the order of operations, see if i can get it to work. What if instead of multipying by .08, I divided by 1/.08? would that still force the pic to use floating point calculations?