I will test out the rest of the circuit later to see if the whole project works as it should.
I will test out the rest of the circuit later to see if the whole project works as it should.
Explore... Chat... Share...
Moderator: igrr
/* This code was written on 10/4/2015.
/* Create a WiFi access point */
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
extern "C" {
#include "user_interface.h"
}
#define WIFI_MODE_AP
/* Set these to your desired credentials. */
const char *ssid = "Proximity Trigger 1";
const char *password = "thereisnospoon";
//Reference as station counter as "devices"
unsigned char devices;
ESP8266WebServer server(80);
void handleRoot() {
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
devices = wifi_softap_get_station_num();
}
void loop() {
if (devices >= 1) {
digitalWrite(2, HIGH);
delay(2000);
digitalWrite(2,LOW);
}
else if (devices <=1) {
digitalWrite(2, HIGH);
delay(2000);
digitalWrite(2, LOW);
}
server.handleClient();
}
unsigned int prevMillis = 0;
boolean ledState = false;
void loop() {
if ((millis() - prevMillis) > 1000) { // 1000 millis = 1 second
prevMillis = millis();
devices = wifi_softap_get_station_num();
if (devices >= 1) {
if (!ledState)
digitalWrite(2, HIGH);
else
digitalWrite(2, LOW);
ledState = !ledState;
}
else {
digitalWrite(2, LOW);
ledState = false;
}
}
server.handleClient();
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]