|
esp32c3 使用blinker apconfig v2 总是无反应。程序可以烧录成功,但是运行后无反应。
#define BLINKER_WIFI
#define BLINKER_APCONFIG_V2
#include <Blinker.h>
// Download OneButton library here:
// https://github.com/mathertel/OneButton
#include "OneButton.h"
#if defined(ESP32)
#define BLINKER_BUTTON_PIN 4
#else
#define BLINKER_BUTTON_PIN D7
#endif
// button trigged when pin input level is LOW
OneButton button(BLINKER_BUTTON_PIN, true);
void deviceReset()
{
// Reset device ,erase WiFi config.
Blinker.reset();
}
void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Blinker.vibrate();
uint32_t BlinkerTime = millis();
Blinker.print("millis", BlinkerTime);
}
void setup()
{
Serial.begin(115200);
BLINKER_DEBUG.stream(Serial);
BLINKER_DEBUG.debugAll();
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Blinker.begin();
Blinker.attachData(dataRead);
button.attachLongPressStop(deviceReset);
}
void loop()
{
Blinker.run();
button.tick();
}
|
|