Dumb Question - Global variable not holding value on change

rgallant:
that is ok I found that I am getting corruption in that value, if i try to print after the if it prints 5 and a garbage character,the second print statement does not print at all. so I have a bigger issue, I need to review my variable declarations may be I have too many for an UNO.

Oops... so much for me keeping out of this. If you find you are running out of variable space, why not look at all your "int"s. Decide which ones both never get a negative value and never contain a value over 255, and change them to "byte". That should save 1 byte for each one you convert... (int is 2 bytes on the UNO.)

Might be a red herring though....