LCD Output Fails After Sketch Reaches 9,000 bytes

Hello, everyone!

So I’m completely new to everything and I’ve only been playing around with Arduino for a few days now, but I would like to ask for your help. The project that I’m currently working on displays a random uplifting message to the LCD after you press a button. The problem that I’m having is that it looks like after the sketch crosses 9,000 bytes, the screen just turns into garbled nonsense.

I’ll include my code below. I had to make it an attachment since it was too long. It’s worth mentioning that I’m no programmer. Haha. I’m just learning! Anyway, could anyone explain why it might be doing this?

Oh, a couple extra details: It compiles and uploads with zero errors. It’s an Arduino Uno.

code.txt (13.4 KB)

Hi carlos

You may be running out of SRAM memory because of the large number of string constants in your code. They get copied into SRAM at run time.

Try changing them to this ...

lcd.print(F("and non-verbal"));

The F() macro keeps them stored just in program memory.

Regards

Ray

That did the trick! Thank you very much!!