Thanks for the help Henrik. I still don't understand it. I've been trying for the past four days and I can't get my variables set up correctly. I've been looking at code on here and other places on the internet and I'm more confused than I was before - most of them are in C. The datasheet seems really confusing to me. I think I've wasted more than 100 hours so far.