Large Font integration issue

Hello all,
I’m having a strange issue with my project. It’s a basic thermostat / oven controller system. It samples a temp probe and outputs it to screen. Buttons set a temp for the oven reach and it turns on and off solenoids. Additionally, I use SPI to communicate with devices and this includes the LCD. I have also integrated a Large Font module within to display both regular font and large font on demand.

** Please note that I use a bunch of hobbled together code that I have attempted to make work to the best of my ability.

The Problem:
When I initially upload the code it works great. The user presses a button to turn-on the oven and set the temp. For example press the button once, it goes to LARGE font “225” degrees (image 1) then after 2 seconds it changes to SMALL font Current temp readout in both fahrenheit and Celsius (image 2).

Image 1

Image 2

After an unknown time, If I restart the arduino the Large font displays erratic (Image 3)… Not sure why, not sure how, but if I try and re-upload the code it does nothing. However if I upload a different sketch of any kind then re-upload the original sketch, it resets the arduino.

I’m thinking something goes wrong with the SPI communication…

I have attached the latest version of my sketch, MainV3.36.zip. Also, have attached all the images as well.

Thank You!

Image 3

MainV3.36.zip (15.1 KB)

I'm not going to download, and unzip a file in order to read your code. I'm sure i'm not the only one with that attitude.

Make it easier for people to help you, by posting your code here.

Well it has many tabs, so posting the code will take me a bit and I will do that in the am. It will be a bit much to post but I will try.

thx

It looks like some or most of the custom characters are getting corrupted. Where in your sketch are the custom characters uploaded? It should be in setup() after lcd.begin() but I don’t see it there. Try adding this:

for (int i=0; i<8; i++)
  lcd.createChar(i+1, custom[i]);

If you are only showing digits in the large font you can save a bunch of SRAM by reducing the bigChars array to:

const char *bigChars[][2] = { 
{"\024\024\024", "\024\024\024"},                 // Space
{"\377", "\007"},                                 // !
{"\005\005", "\024\024"},                         // "
{"\004\377\004\377\004", "\001\377\001\377\001"}, // #
{"\010\377\006", "\007\377\005"},                 // $
{"\001\024\004\001", "\004\001\024\004"},         // %
{"\010\006\002\024", "\003\007\002\004"},         // &
{"\005", "\024"},                                 // '
{"\010\001", "\003\004"},                         // (
{"\001\002", "\004\005"},                         // )
{"\001\004\004\001", "\004\001\001\004"},         // *
{"\004\377\004", "\001\377\001"},                 // +
{"\024", "\005"},                                 // ,
{"\004\004\004", "\024\024\024"},                 // -
{"\024", "\004"},                                 // .
{"\024\024\004\001", "\004\001\024\024"},         // /
{"\010\001\002", "\003\004\005"},                 // 0
{"\001\002\024", "\024\377\024"},                 // 1
{"\006\006\002", "\003\007\007"},                 // 2
{"\006\006\002", "\007\007\005"},                 // 3
{"\003\004\002", "\024\024\377"},                 // 4
{"\377\006\006", "\007\007\005"},                 // 5
{"\010\006\006", "\003\007\005"},                 // 6
{"\001\001\002", "\024\010\024"},                 // 7
{"\010\006\002", "\003\007\005"},                 // 8
{"\010\006\002", "\024\024\377"}                 // 9
};

Then in LCD_LgFont change the code to:

 if (ch < ' ' || ch > '9') // If outside our table range, do nothing
    return 0;

Hi John,
Let me give that a go, thanks for jumping in!

johnwasser:
It looks like some or most of the custom characters are getting corrupted. Where in your sketch are the custom characters uploaded? It should be in setup() after lcd.begin() but I don’t see it there. Try adding this:

for (int i=0; i<8; i++)

lcd.createChar(i+1, custom[i]);





If you are only showing digits in the large font you can save a bunch of SRAM by reducing the bigChars array to:


const char *bigChars[2] = {
{"\024\024\024", “\024\024\024”},                // Space
{"\377", “\007”},                                // !
{"\005\005", “\024\024”},                        // "
{"\004\377\004\377\004", “\001\377\001\377\001”}, // #
{"\010\377\006", “\007\377\005”},                // $
{"\001\024\004\001", “\004\001\024\004”},        // %
{"\010\006\002\024", “\003\007\002\004”},        // &
{"\005", “\024”},                                // ’
{"\010\001", “\003\004”},                        // (
{"\001\002", “\004\005”},                        // )
{"\001\004\004\001", “\004\001\001\004”},        // *
{"\004\377\004", “\001\377\001”},                // +
{"\024", “\005”},                                // ,
{"\004\004\004", “\024\024\024”},                // -
{"\024", “\004”},                                // .
{"\024\024\004\001", “\004\001\024\024”},        // /
{"\010\001\002", “\003\004\005”},                // 0
{"\001\002\024", “\024\377\024”},                // 1
{"\006\006\002", “\003\007\007”},                // 2
{"\006\006\002", “\007\007\005”},                // 3
{"\003\004\002", “\024\024\377”},                // 4
{"\377\006\006", “\007\007\005”},                // 5
{"\010\006\006", “\003\007\005”},                // 6
{"\001\001\002", “\024\010\024”},                // 7
{"\010\006\002", “\003\007\005”},                // 8
{"\010\006\002", “\024\024\377”}                // 9
};




Then in LCD_LgFont change the code to:


if (ch < ’ ’ || ch > ‘9’) // If outside our table range, do nothing
    return 0;

John,
You were correct, the for statement was missing. It must have dropped off in one of my versions! Thank you for noticing.

johnwasser:
It looks like some or most of the custom characters are getting corrupted. Where in your sketch are the custom characters uploaded? It should be in setup() after lcd.begin() but I don’t see it there. Try adding this:

for (int i=0; i<8; i++)

lcd.createChar(i+1, custom[i]);




Also,
What can I do to limit letters to "O", "C", & "L"

I tried deleting what i don't need and changing the if statement but with no success.