伙计们,我想将我的脉冲传感器数据传输到thinger.io网站,以实时显示我的数据图表 我使用nodeMCU 8266构建了一个显示心跳的代码,它可以在arduino ide中工作,但是数据可以 传输到网站与串口显示器不一样,我不知道如何修复它 这是我的代码
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <ThingerWifi.h>
double alpha=0.75;
static double oldValue=0;
int period=20;
double refresh=0.0;
const char* host = "37.239.215.71";
ThingerWifi thing("Tabarek", "nodeMCU", "Tab&bar16");
void setup() {
thing.add_wifi("tabark", "tabarekghassan");
Serial.begin(115200);
delay(500);
pinMode(17, OUTPUT);
thing.add_wifi("tabark", "tabarekghassan");
thing["pulse"]<< digitalPin(17);
thing["millis"]>> outputValue (millis());
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP()); }
void loop() {
delay(5000);
Serial.print("connecting to ");
Serial.println(host);
thing.handle();
int beat=analogRead(17);
double pulse=alpha*oldValue+(0-alpha)*beat;
refresh=pulse-oldValue;
Serial.print(" value: ");
Serial.println(beat/7);
oldValue=pulse;
double oldrefresh=refresh;
delay(period*7);
Serial.println(" ..... ");
}
为了让它发送正确的值,我必须做些什么?