Hi again. I want to use a timer interrupt to control the signal i send to my servo. I'm new to this type of programming, but I've been reading the axon demo source code, the timerx8.h header in particular.
I thought that since the atmega640 runs at 16Mhz, and i was using an 8 bit timer (timer0) with a prescaler of 1024,
that I would have an interrupt rate of 256 / (16,000,000 / 1024) = 0.016384ms.
so I used the timerAttach function, and tried to use first a float, and then a double to count the iterations (ie, "msCount += 0.016384"). I thought at first that i could just do a "static float msCount=0.0", but it seemed like the thing wasn't powering up with that method... so i switch it to a global "volatile float msCount=0.0", and it runs. But it fires at an entirely different (slower) rate than what I thought it would. (it didn't count to 1000, or 1 second, in the 15 or so seconds that i watched it.)
Where did I do wrong? And why can't i use a static variable in the interrupt function?