求助录入程序后8266不停复位重启-Arduino中文社区 - Powered by Discuz! Archiver

歆宇 发表于 2020-2-23 14:25

求助录入程序后8266不停复位重启

#define BLINKER_WIFI

#include <Blinker.h>
#include <DHT.h>
#include "HX711.h"

char auth[] = "84e2c21bc971";
char ssid[] = "PDCN";
char pswd[] = "13794756048zz";

BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");
BlinkerNumber SOIL("soil");
BlinkerNumber WEIGHT("weight");
#define DHTPIN    13
#define SOIL_PIN05      
#define DHTTYPE DHT11   
int soil_humidity =0;
float Weight = 0;


DHT dht(DHTPIN, DHTTYPE);

float humi_read = 0, temp_read = 0;

void heartbeat()
{
    HUMI.print(humi_read);
    TEMP.print(temp_read);
    SOIL.print(soil_humidity);
    WEIGHT.print(Weight);
}

void setup()
{
    Serial.begin(115200);
    BLINKER_DEBUG.stream(Serial);
    BLINKER_DEBUG.debugAll();
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN, LOW);
    pinMode(SOIL_PIN, INPUT);
    Init_Hx711();
    Get_Maopi();
    Blinker.begin(auth, ssid, pswd);
    Blinker.attachHeartbeat(heartbeat);
    dht.begin();
}

void loop()
{
    Blinker.run();
    Weight = Get_Weight();
    soil_humidity = analogRead(SOIL_PIN);
    Serial.println(soil_humidity);
    float h = dht.readHumidity();
    float t = dht.readTemperature();
   
    if (isnan(h) || isnan(t))
    {
      BLINKER_LOG("Failed to read from DHT sensor!");
    }
    else
    {
      BLINKER_LOG("Humidity: ", h, " %");
      BLINKER_LOG("Temperature: ", t, " *C");
      humi_read = h;
      temp_read = t;
    }

    Blinker.delay(2000);
}

串口输出如下
Soft WDT reset

>>>stack>>>

ctx: cont
sp: 3ffffda0 end: 3fffffc0 offset: 01b0
3fffff50:3fffdad0 3fff032c 00000002 40201108
3fffff60:3fffdad0 3fff032c 00000002 40205b62
3fffff70:feefeffe feefeffe feefeffe feefeffe
3fffff80:feefeffe feefeffe feefeffe feefeffe
3fffff90:feefeffe feefeffe feefeffe feefeffe
3fffffa0:feefeffe 00000000 3fff098c 4021ef24
3fffffb0:feefeffe feefeffe 3ffe8570 40100ec5
<<<stack<<<

ets Jan8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld


板子上的灯一直在闪,有什么办法解决吗
是在加入hx711模块后出现的。

奈何col 发表于 2020-2-23 14:57

测试例程,如果例程没问题,就是你库的问题。库里面请不要使用delay等耗时操作

jh800215 发表于 2020-2-23 15:05

检查板子供电,是否供电不足

歆宇 发表于 2020-2-23 16:08

奈何col 发表于 2020-2-23 14:57
测试例程,如果例程没问题,就是你库的问题。库里面请不要使用delay等耗时操作 ...

是库的问题,解决了,感谢。

歆宇 发表于 2020-2-23 16:09

jh800215 发表于 2020-2-23 15:05
检查板子供电,是否供电不足

供电正常,是hx711库的问题,已解决
页: [1]
查看完整版本: 求助录入程序后8266不停复位重启