[Solved] Code stops working when switch-case is uncommented

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:

code.txt (11.6 KB)

Sorry but that file has all sorts of wired characters in it so it won't even compile.

You've got these big long lines
client.println("GET /json.htm?type=command&param=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.

They are mostly the same, sometimes the idx number is different too.

I am not sure how to do either of your suggestions, but at least I know where to look.

Thanks

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

Glad you got it figured out.