|
|
发表于 2014-2-28 23:24:51
|
显示全部楼层
本帖最后由 Super169 于 2014-2-28 23:27 编辑
請看看這裡: http://arduino.cc/en/Tutorial/Memory#.UxCpO_mSwfg
The ATmega328 chip found on the Uno has the following amounts of memory:
Flash 32k bytes (of which .5k is used for the bootloader)
SRAM 2k bytes
EEPROM 1k byte
The ATmega2560 in the Mega2560 has larger memory space :
Flash 256k bytes (of which 8k is used for the bootloader)
SRAM 8k bytes
EEPROM 4k byte
如果你用的是 ATmega328 chip, SRAM 只有 2k bytes.
SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs.
If you run out of SRAM, your program may fail in unexpected ways; it will appear to upload successfully, but not run, or run strangely. To check if this is happening, you can try commenting out or shortening the strings or other data structures in your sketch (without changing the code). If it then runs successfully, you're probably running out of SRAM.
如果 SRAM 不足, 會出現不正常結果. |
|