Society of Robots - Robot Forum

Software => Software => Topic started by: Tomas on August 04, 2009, 06:06:41 AM

Title: timed interrupt routine on axon
Post by: Tomas on August 04, 2009, 06:06:41 AM
Hi. I want my axon to check if there is any data in the uart buffer. If there is data there, I want it to change the value in a global variable to the number 1. I want it to do this, lets say, one hundred times a second.

Version 1.08 does interrupt a bit different than the last one I used (1.01 I believe). Could anyone provide an example on how to do a timed interrupt function with the new sourcecode? Im at work right now so I cant provide the error message I got when I tried the code that worked in 1.01, but there was a few errors I could not resolve (I know the interrupt function has changed it name slightly, thats not the problem)

I'll provide my error log when I come home. But if anyone could have provided an example in the meantime, I would be very pleased :)

Thanks for any help :)
Title: Re: timed interrupt routine on axon
Post by: sonictj on August 04, 2009, 08:48:55 AM
Here is some code I use for doing just about that.  The way it works is the received bytes are cast into a buffer.  the way to tell how many bytes you have is to see what the difference is between head and tail.