Resetting my LCD counter to 0

Hello,

I am making a counter with an IR optic. I would like for the count to be displayed on my LCD display. I have wired a button to reset the counter to 0. It works at resetting the counter as noted in the serial monitor display, however my LCD sets the first integer to 0 not the remaining.

If my count was displayed on the LCD as "14" I push the button and the number changes to "04" not 0.

How do I change this? My code is attached.

Thanks!

IR_sensor.ino (924 Bytes)

Read the "How to use" stickies at the head of the forum, and post your code in the proper manner, using </> tags. You are probably missing some sort of lcd clear command.

Because you have not posted properly, I cannot see your code. However, you probably want to output a space character after you output the number.

Right, first things first.

Go and read the instructions, then go back and modify your post (use the "More --> Modify" option to the bottom right of the post) to insert the code in that post so we can examine it conveniently and accurately. No need to make a second post.

Note: Also mark up any data in the same way. This includes error output that you get from the IDE.

And - before you post code, use "Auto Format" in the Tools menu to properly present the code. Then Ctrl-A to mark it all and the "Edit --> Save for Forum" option will add the "code" tags for you to post that code here.

Try and avoid unnecessary white space (blank lines). You should only use these to separate functional blocks of code.