显示了如下报错
================== Blinker Timer loaded! ==================
Warning!EEPROM address 1536-2431 is used for Blinker Timer!
============= DON'T USE THESE EEPROM ADDRESS! =============
知道应该是占用了空间的问题,可是应该怎么修改呀?
原代码拟使用wifiiduino来实现脉搏传感器pulse sensor的数据读入
以下是源码
[pre]#define BLINKER_WITHOUT_SSL
#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most acurate BPM math.
#define BLINKER_WIFI
#include <Blinker.h>
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground Library.
char auth[] = "1c58f9859b1a"; //上一步中在app中获取到的Secret Key(新建设备的秘钥)
char ssid[] = "jzndd"; //你的WiFi热点名称
char pswd[] = "jzn13509883120"; //你的WiFi密码
int BPM_read=0;
BlinkerNumber PLUSE("pulse");
// Variables
const int PulseWire = A0; // 接A0接口
int Threshold = 550; // Determine which Signal to "count as a beat" and which to ignore.
// Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting.
// Otherwise leave the default "550" value.
PulseSensorPlayground pulseSensor; // Creates an instance of the PulseSensorPlayground object called "pulseSensor"
void heartbeat()
{
//反馈心率数据
PLUSE.print(BPM_read);
}
void setup() {
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
// Configure the PulseSensor object, by assigning our variables to it.
pulseSensor.analogInput(PulseWire);
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and "began" seeing a signal.
Blinker.begin(auth, ssid, pswd);
Blinker.attachHeartbeat(heartbeat);
pulseSensor.begin();
}
void loop() {
Blinker.run();
int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int".
// "myBPM" hold this BPM value now.
if(pulseSensor.sawStartOfBeat())
{
Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened".
Serial.print("BPM: "); // Print phrase "BPM: "
Serial.println(myBPM); // Print the value inside of myBPM.
BLINKER_LOG("BPM: ", myBPM);
BPM_read=myBPM;
}
Blinker.delay(2000);
}[/pre] |