[mw_shl_code=arduino,true]#define BLINKER_WIFI
#include <Blinker.h>
#include <DHT.h>
#include "HX711.h"
char auth[] = "84e2c21bc971";
char ssid[] = "DCN";
char pswd[] = "13794756048zz";
BlinkerNumber HUMI("humi");
BlinkerNumber TEMP("temp");
BlinkerNumber SOIL("soil");
BlinkerNumber WEIGHT("weight");
#define DHTPIN 13
#define SOIL_PIN 05
#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);
}[/mw_shl_code]
串口输出如下
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 Jan 8 2013,rst cause:2, boot mode3,6)
load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld
板子上的灯一直在闪,有什么办法解决吗
是在加入hx711模块后出现的。
|