【发布时间】:2017-08-16 16:59:15
【问题描述】:
当我在 Arduino 上为 ESP8266 编译一个简单的 Blink 草图时,看起来 38% 的内存被某些东西占用了:
全局变量使用 31,576 字节 (38%) 的动态内存,剩下 50,344 字节用于局部变量。最大值为 81,920 字节。
这段记忆去哪儿了?我有一个需要大量内存的应用程序,想看看我是否可以禁用/减少某些 Arduino 内置库的使用。
代码如下:
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
// Initialize the LED_BUILTIN pin as an output
}
void loop() {
digitalWrite(LED_BUILTIN, LOW);
// Turn the LED on (Note that LOW is the voltage level
// but actually the LED is on; this is because
// it is acive low on the ESP-01)
delay(1000);
// Wait for a second
digitalWrite(LED_BUILTIN, HIGH);
// Turn the LED off by making the voltage HIGH
delay(2000);
// Wait for two seconds (to demonstrate the active low LED)
}
【问题讨论】:
标签: memory arduino ram esp8266