WeMos (ESP8266) Function While

六眼飞鱼酱① 提交于 2019-12-14 03:36:21

问题


My function while have a problem. When I comment this line doesn't have error in monitor serial, but, when I use all function show this error on monitor serial.

void windvelocity(){
speedwind = 0;
counter = 0;  
attachInterrupt(0, addcount, RISING);
unsigned long millis();       
long startTime = millis();
while(millis() < startTime + period) {
}
}

When I make upload this function to wemos, the Serial Monitor print this

ets Jan  8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

回答1:


This ain't a error message but a standard boot message. To properly answer your question we would need to know what board exactly you use, how you connected your parts (what pins, voltage, etc), what parts and of course the full code.

Please remember that the breakout boards for the esp8266 (for example the node mcu) are confusing sometimes. So always double check what pins you want to use and what pins you declared in your code.

For example, if you want to have D0 as the output for something, probably a LED, you will have to declare it as output.

pinMode(16, Output);           // set pin to output

Or when wanting to use it as input (for example for sensors) use

pinMode(16, Input);            // set pin to input

Why 16 when wanting to use D0 you ask? Take a look at this for more information on how to refer to the pins as input or output . There you can see what pins to use.




回答2:


Reset cause 2 means a reset by the reset pin trigger. Attach your anemometer to another pin and change your code to match the hardware layout.



来源:https://stackoverflow.com/questions/46722951/wemos-esp8266-function-while

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!