Some of you already helped me debug this project, I thought I'd try my luck here again for another issue I don't know how to handle.
I'm making a metronome and my LCD keeps printing random characters once the metronome is ticking, simultaneously with the tones. Once it got started, it also always does it when I press a button or turn the potentiometer.
Now I say random but there are recurring sequences of characters and it often starts with filling each square of the screen from left to right and top to bottom rhythmically with superimposed horizontal lines.
Anyway here's my entire code and a couple of pictures of the LCD.
my wild arse guess is you are printing a string and it doesn't know how long the string is so its just writing anything it find in memory. Take out the lcd,print line //and see if it stops.
Zinston:
Once it got started, it also always does it when I press a button or turn the potentiometer.
Now I say random but there are recurring sequences of characters and it often starts with filling each square of the screen from left to right and top to bottom rhythmically with superimposed horizontal lines.
How much current does your piezo speaker draw from the PIEZZO_PIN?
Piezo speaker datasheet?
Maybee voltage spikes due to too high current?
Test: Does the same LCD problem occur if the PIEZZO_PIN is not connected to the piezo speaker?
Or maybe a loose contact in one of the cables between Arduino and LCD.