Answered step by step
Verified Expert Solution
Question
1 Approved Answer
flowchart of this code #include WiFiServer server ( 8 0 ) ; const char * ssdi = ; const char * password =
flowchart of this code
#include
WiFiServer server;
const char ssdi ;
const char password ;
int contconexion ;
String estadosalida "off";
String estadosalida "off";
String estadosalida "off";
String estadosalida "off";
String estadosalida "off";
String estadosalida "off";
String estadosalida "off";
bool d;
bool d;
bool d;
bool i;
bool i;
bool i;
bool cl;
Control velocidad motores
int pasos ;
int tempesp ;
int tempespgr ;
int temp ;
Definicin de pines
#define INA
#define INB
#define INC
#define IND
#define INA
#define INB
#define INC
#define IND
#define INA
#define INB
#define INC
#define IND
#define INA
#define SW
#define SW
#define SW
#define SW
#define SW
#define SW
void setup
Serial.begin;
Serial.println;
pinModeINA OUTPUT;
pinModeINB OUTPUT;
pinModeINC OUTPUT;
pinModeIND OUTPUT;
pinModeINA OUTPUT;
pinModeINB OUTPUT;
pinModeINC OUTPUT;
pinModeIND OUTPUT;
pinModeINA OUTPUT;
pinModeINB OUTPUT;
pinModeINC OUTPUT;
pinModeIND OUTPUT;
pinModeINA OUTPUT;
pinModeSW INPUT;
pinModeSW INPUT;
pinModeSW INPUT;
pinModeSW INPUT;
pinModeSW INPUT;
pinModeSW INPUT;
delaytemp;
WiFi.beginssdi password;
whileWiFistatus WLCONNECTED and contconexion
contconexion;
delay;
Serial.println;
if contconexion
ip fija
IPAddress ip;
IPAddress gateway;
IPAddress subnet;
WiFi.configip gateway, subnet;
Serial.println;
Serial.printlnWiFi conectado";
Serial.printlnWiFilocalIP;
server.begin; iniciamos el servidor
else
Serial.println;
Serial.printlnError de conexion";
void loop
put your main code here, to run repeatedly:
Serial.begin;
WiFiClient client server.available; Escucha a los clientes entrantes
ifclientsi se conecta un nuevo cliente
Serial.printlnNew Client.";
String currentLine ;
while clientconnectedloop mientras el cliente este conectado
ifclientavailablesi hay bytes para leer desde el cliente
char c client.read; lee un byte
Serial.writec; imprime ese byte en el monitor serial
header c;
if c
si el byte es un caracter de salto de linea
si la nueva linea est en blanco significa que es el fin del
HTTP request del cliente, entonces respondemos:
ifcurrentLinelength
client.printlnHTTP OK;
client.printlnContenttype:texthtml;
client.printlnConnection: close";
client.println;
ifheaderindexOfGET onright
Serial.printlnGPIO onright;
estadosalidaon;
dtrue;
else ifheaderindexOfGET onleft
Serial.printlnGPIO onleft;
estadosalidaon;
itrue;
else ifheaderindexOfGET onright
Serial.printlnGPIO onright;
estadosalidaon;
dtrue;
else ifheaderindexOfGET onleft
Serial.printlnGPIO onleft;
estadosalidaon;
itrue;
else ifheaderindexOfGET onright
Serial.printlnGPIO onright;
estadosalidaon;
dtrue;
else ifheaderindexOfGET onleft
Serial.printlnGPIO onleft;
estadosalidaon;
itrue;
else if headerindexOfGET close
Serial.printlnGPIO close";
estadosalidaon;
cltrue;
else if headerindexOfGET open
Serial.printlnGPIO open";
estadosalida "off";
clfalse;
else ifheaderindexOfGET stop
Serial.printlnGPIO stop";
estadosalida "off";
estadosalida "off";
estadosalida "off";
estadosalida "off";
estadosalida "off";
estadosalida "off";
dfalse;
dfalse;
dfalse;
ifalse;
ifalse;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started