i change the code
#include <WiFi.h>
#include <OneButton.h>
#include <ExBreaker.h>
OneButton button(13, true);
int i = 0;
int statuz = WL_IDLE_STATUS;
int wstatus = WiFi.status();
void doubleClick() {
state = ! state;
}
void setup() {
button.attachDoubleClick(doubleClick);
Connect();
Serial.begin(115200);
}
void loop() {
// keep watching the push button:
button.tick();
// You can implement other code in here or just wait a while
delay(10);
if ( state == 0) {
WiFi.begin();
Serial.println(WiFi.localIP());
} else {
Disconnect();
}
}
still not fix the problem
serial monitor
15:42:25.334 -> E (175026) wifi:sta is connecting, return error
15:42:25.334 -> 0.0.0.0
state declared on library ExBreaker.h if i combine all just like this
#include <WiFi.h>
#include <OneButton.h>
#include <ExBreaker.h>
OneButton button(13, true);
const char *ssid = "Get";
const char *password = "12345678";
int state = 0;
int i = 0;
int statuz = WL_IDLE_STATUS;
int wstatus = WiFi.status();
void doubleClick() {
state = ! state;
}
void setup() {
button.attachDoubleClick(doubleClick);
Connect();
Serial.begin(115200);
}
void loop() {
// keep watching the push button:
button.tick();
// You can implement other code in here or just wait a while
delay(10);
if ( state == 0) {
WiFi.begin();
Serial.println(WiFi.localIP());
} else {
Disconnect();
}
}
sorry for being dumb i dont know waht snippets is because im new here i hope you all understand