Skip to main content
Arduino

Return to Revisions

3 of 3
replaced http://arduino.stackexchange.com/ with https://arduino.stackexchange.com/

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?

AltStyle によって変換されたページ (->オリジナル) /