I am trying to increase a value by 5 the value is an integer, the intent is to increment the value if an invalid RFID card is read.Card reading LCD display works fine, I have done or am not doing something right but I just can not see it.

Code Section that is failing

Notes:eXtime is declared GlobalIt is only used in this area -searched the code to make sureSerial output shows the value as zero everywhere but inside the if when is incremented.This is not correct function as I understand it a global variable should maintain it's value until the loop restarts

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.

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.)

That is why I am confused, your explanation is exactly my understanding of how things should be working, but they are not. I was hoping I had simply done something unusually dumb and missed it. I will post or attach the whole section of code later.

Unless you can post a complete sketch that demonstrates the problem, you're pretty much wasting your time trying to figure it out from code snippets. If you're able to produce a simpler sketch that demonstrates the problem, so much the better. But the code you post needs to compile, run and demonstrate the problem.

I only provide help via the forum - please do not contact me for private consultancy.

if(mySerial.available() > 0) { val = mySerial.read(); //The mySerial.read() procedure is called, but the result is not printed because I don't want the "error message: 1" cluttering up the serial monitor if (val != 1) //If the error code is anything other than 1, then the RFID tag was not read correctly and any data collected is meaningless. In this case since we don't care about the resultant values they can be suppressed {suppressAll();} }