-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal LED as status of wifi #20
Comments
Hi Jonas, Olli |
Hi, So this is preliminary version and status pulses etc. still need to be defined and documented states to be recognizable . Olli |
Hello Olli,
I added some stuff in my local version to make the internal pcb mounted LED connected to gpio 2 to show status of the wifi connection, for easier first approach troubleshooting.
Many boards seem to have the internal LED connected to GPIO2, I do not know if all have.
Led off = wifi not connected and ESP still in setup, Led solid on = wifi connected, Led blinking = in AP mode.
//So in the end of the definitions I added:
#define onboard_led 2
bool onboard_led_state = LOW;
unsigned long last_millis = 0;
//In the beginning of setup I added:
pinMode(onboard_led, OUTPUT);
//Outside the loop I created the blink_led_or_not void:
void blink_led_or_not(){
if(wifi_in_setup_mode == true){
if(millis()-last_millis > 500){
onboard_led_state = !onboard_led_state;
digitalWrite(onboard_led, onboard_led_state);
}
}
if(wifi_in_setup_mode == false){
digitalWrite(onboard_led, HIGH);
}
}
//And in the beginning of loop I added:
blink_led_or_not();
//Jonas
The text was updated successfully, but these errors were encountered: