Read this before posting a programming question ...

Post your code!

Please change that to "Post your complete sketch!" Too many people post snippets of code that have nothing to do with the actual problem.