2
99
1256
论坛积极会员
void setup() { Serial.begin(115200); Serial.setTimeout(2000); // Wait for serial to initialize. while(!Serial) { } Serial.println("I'm awake."); Serial.println("Going into deep sleep for 20 seconds"); // 一但遇到以下方法ESP就会进入deepSleep状态 ESP.deepSleep(20e6); // 20e6 is 20 microseconds } void loop() { }
使用道具 举报
3
145
927
高级会员
五岁能抬头
void ReadSensor() { while (Blynk.connect() == false) { // Wait until connected } SensorsReading = “00.00”; if (Serial.available()) { delay(100); SensorsReading = Serial.readString(); } Voltage = SensorsReading.toFloat(); Blynk.virtualWrite(V1, Voltage); Blynk.virtualWrite(V2, ESP.getVcc()); ESP.deepSleep(20e6); delay(100); }
chaobt 发表于 2019-3-22 18:56 貌似deepSleep不能放在setup或者main loop里,可以这样写: [code]void ReadSensor() {
15
297
1511
论坛技术达人
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2024-11-25 05:48 , Processed in 0.245811 second(s), 27 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.