|
#define BLINKER_WIFI
#include <Blinker.h>
char auth[] = "f9d569a8bfc1";
char ssid[] = "10010";
char pswd[] = "110110110";
BlinkerNumber Kong("kong");
#define kong A0
uint32_t read_time = 0;
int kong_read;
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Blinker.vibrate();
uint32_t BlinkerTime = millis();
Blinker.print(BlinkerTime);
Blinker.print("millis", BlinkerTime);
}
void heartbeat()
{
Kong.print(kong_read*123.25);
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
pinMode(kong,INPUT);
Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
Blinker.attachHeartbeat(heartbeat);
}
void loop()
{
int k = analogRead(A0);
kong_read = k;
BLINKER_LOG("Kong Qi: ", k, " HZ");
Blinker.run();
Blinker.delay(2);
}
[img]file:///C:\Users\GB\Documents\Tencent Files\853622877\Image\Group\85VP26RUU[9M6AUGVAL6@[A.png[/img]
这是代码和手机上的截图
问题如下: 1.振动传感器和arduino和nodemcu上读取的数值不一样,我猜想是否是nodemcu的A0的引脚输入电压问题
2.心跳包发送的频率能否调快点,显示频率有点低了
|
|