I have a sketch which responds to IR signals, running a specific case depending on the IR signal it receives. It works correctly with 13 cases but when I uncomment either of the last two, the whole sketch stops working. I get nothing in the Serial monitor and it doesnt respond to any IR signals.
I thought it might be due to memory usage so I have tried to optimise it as best I can by removing Serial.println lines.
Could it be memory usage or something else?
My code is attached, which works until I uncomment case 1552 or 272:
You've got these big long lines
client.println("GET /json.htm?type=command¶m=switchlight&idx=6&switchcmd=Set%20Level&level=16 HTTP/1.0"
that suck up tons of SRAM - looks like 93 characters x 16 = 1488 bytes?
They look to be identical except for the little bit at the end: =16 HTTP/1.0
Put the strings in PROGMEM, or find a way to call out most of the line as 1 variable (function call?) and just have the cases print the last little bit.
Finally got round to looking at this again and now I have learnt how PROGMEM works, the code works perfectly.
Thanks very much for your advice CrossRoads.
jcaira