Andy, your code looks workable. To simplify things, I use a tool from http://www.miscel.dk called miscellaneous electronic calculations. In that you will find an integer math module that tells you 1.64 is same as 41/25 if you want to use 8 bit math. It's a nice tool to augment your collection and I suggest you give it a try
Bookmarks