Hallo,
ich wollte beim ESP-S alle AD Wandler benutzen und die erhaltenen Werte über WiFi an den Firefox Browser als Werte ausgeben. Ein passendendes Programm habe ich auch gefunden.
Zunächst habe ich 4 AD Ports abgefragt. 2 funktionieren ,2 nicht.
Weiß jemand eine Lösung?
/*
ESP32 mDNS responder sample
This is an example of an HTTP server that is accessible
via http://esp32.local URL thanks to mDNS responder.
Instructions:
- Update WiFi SSID and password as necessary.
- Flash the sketch to the ESP32 board
- Install host software:
- For Linux, install Avahi (http://avahi.org/).
- For Windows, install Bonjour (http://www.apple.com/support/bonjour/).
- For Mac OSX and iOS support is built in through Bonjour already.
- Point your browser to http://esp32.local, you should see a response.
*/
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WiFiClient.h>
const char *ssid = "...................";
const char *password = "......................";
double a,b,c,d,e ;
long z=0;
// TCP server at port 80 will respond to HTTP requests
WiFiServer server(80);
void setup(void)
{
Serial.begin(115200);
analogReadResolution(12);
// Connect to WiFi network
WiFi.begin(ssid, password);
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Start TCP (HTTP) server
server.begin();
Serial.println("TCP server started");
// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);
z++;
}
void loop(void)
{{
b=analogReadMilliVolts(33);
c=analogReadMilliVolts(27);
d=analogReadMilliVolts(26);
e=analogReadMilliVolts(32);
Serial.println(d);
// Serial.println(z);
}
//delay(1000);
{
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
//delay(100);
return;
}
client.available();
client.connected();
client.readStringUntil('\r');
client.println("<h1>Seitenüberschrift</h1>");
client.print("Spannungswert ");
client.println(b);
client.print(" Spannungswert ");
client.println(c);
client.print(" Spannungswert ");
client.println(d);
client.print(" Spannungswert ");
client.println(e);
client.println(z);
client.stop();
}
}