EasyManua.ls Logo

sparkfun ESP8266 - Example: AP Web Server

sparkfun ESP8266
33 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Example screenshot from our communal data.sparkfun.com stream.
Read through the comments in the code to get a line-by-line breakdown of what’s going on in
the sketch.
Example Sketch: AP Web Server
Not only can the ESP8266 connect to a WiFi network and interact with the Internet, but it can
also set up a network of its own, allowing other devices to connect directly to it. This example
demonstrates how to turn the ESP8266 into an access point (AP), and serve up web pages to
any connected client.
Copy and paste the code from below, or download it here.
COPY CODE
#include <ESP8266WiFi.h>
//////////////////////// WiFi Definitions ////////////////////////const char WiFiAPPSK[] = "sparkfun";
/////////////////////// Pin Definitions ///////////////////////const int LED_PIN = 5; // Thing's onboard, green LEDconst int
ANALOG_PIN = A0; // The only analog pin on the Thingconst int DIGITAL_PIN = 12; // Digital pin to be read
WiFiServer server(80);
void setup()
{
initHardware();
setupWiFi();
server.begin();
}
void loop()
{

Other manuals for sparkfun ESP8266