Hi there everybody
So I'm working on a project where I'm trying to get an LED to switch on when there is no WiFi signal and switches off when it has a WiFi signal.
My problem is that when the code starts the script runs fine, however it appears to only run once and then not again.
Would anybody be able to look at the code I'm using and let me know where I'm going wrong?
Code follows below
#include <WiFi.h>
#include <SPI.h>
char ssid[] = "MyNetwork"; // your network SSID (name) removed for posting to forum
char pass[] = "*******"; // your network password removed for posting to forum
int status = WL_IDLE_STATUS; // the Wifi radio's status
int led1 = 8;
void setup() {
// initialize serial:
Serial.begin(9600);
pinMode(8, OUTPUT);
//This is on startup only
status = WiFi.begin(ssid, pass);
}
void loop() {
// if connected, switch LED off:
//status = WiFi.begin(ssid, pass);
if (status != WL_CONNECTED)
digitalWrite(8, HIGH);
if (status = WL_CONNECTED);
digitalWrite(8, LOW);
delay(0);
}