What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output");
This takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output"));
This takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam()
and use that in debugging your sketch to see how much free space you have.
Relevant question: What can I do if I run out of Flash memory or SRAM? What can I do if I run out of Flash memory or SRAM?
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output");
This takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output"));
This takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam()
and use that in debugging your sketch to see how much free space you have.
Relevant question: What can I do if I run out of Flash memory or SRAM?
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output");
This takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output"));
This takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam()
and use that in debugging your sketch to see how much free space you have.
Relevant question: What can I do if I run out of Flash memory or SRAM?
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output");
Serial.print("Some text you want output"); //This takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output"));
Serial.print(F("Some text you want output")); //This takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam()freeRam()
and use that in debugging your sketch to see how much free space you have.
Relevant question: What can I do if I run out of Flash memory or SRAM?
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output"); // takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output")); // takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam() and use that in debugging your sketch to see how much free space you have.
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output");
This takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output"));
This takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam()
and use that in debugging your sketch to see how much free space you have.
Relevant question: What can I do if I run out of Flash memory or SRAM?
What arduino board is being used? I find that some webserver code takes up a lot of the SRAM and in an UNO this leaves very little space for other code.
To save SRAM use the F macro on all the Serial.print statements that have quoted text. i.e:
Serial.print("Some text you want output"); // takes up SRAM when running. 1 byte per letter and space.
Serial.print(F("Some text you want output")); // takes up no SRAM as it is stored in program space and is makes a big difference.
Search for a freeRam() and use that in debugging your sketch to see how much free space you have.