Our website uses necessary cookies to enable basic functions and optional cookies to help us to enhance your user experience. Learn more about our cookie policy by clicking "Learn More".
Accept All Only Necessary Cookies
Icona Iot Servo Slider

1 by Incatdible


Aug 18, 2018

Informazioni su Iot Servo Slider

Per controllare il servo attraverso il cursore sul app

This app used to control the servo from iot device that run arduino ide, for example nodeMCU, Wemos, ESP8266.

Below the code for the arduino:

#include

#include

#include

#include

Servo servo;

const char* ssid = "WIFI_SSID"; // Enter Your wifi SSID here

const char* password = "WIFI_PASSWORD"; // Enter Your Wifi Password Here

ESP8266WebServer server(80);

//The function we want to call

void slider(){

// Serial.println(server.args()); //to known number of parameter

// Serial.println(server.argName(i)); //Get the name of the parameter

Serial.println(server.arg(0)); //Print value receive

int val = server.arg(0).toInt(); //Servo write only read integer

servo.write(val);

}

//The function if no function found

void handleNotFound(){

String message = "File Not Found\n\n";

message += "URI: ";

message += server.uri();

message += "\nMethod: ";

message += (server.method() == HTTP_GET)?"GET":"POST";

message += "\nArguments: ";

message += server.args();

message += "\n";

for (uint8_t i=0; i message += " " + server.argName(i) + ": " + server.arg(i) + "\n";

}

server.send(404, "text/plain", message);

}

void setup() {

Serial.begin(115200);

WiFi.begin(ssid, password);

Serial.println("");

// Wait for connection

while (WiFi.status() != WL_CONNECTED) {

delay(500);

Serial.print(".");

}

Serial.println("");

Serial.print("Connected to ");

Serial.println(ssid);

Serial.print("IP address: ");

Serial.println(WiFi.localIP());

if (MDNS.begin("esp8266")) {

Serial.println("MDNS responder started");

}

//Set the option when we put at url

//the slider function will be called

server.on("/Slider",slider);

//When input the IP address on url

server.on("/", [](){

server.send(200, "text/plain", "this works as well");

});

server.onNotFound(handleNotFound);

server.begin();

Serial.println("HTTP server started");

servo.attach(D3);

}

void loop() {

server.handleClient();

}

Novità nell'ultima versione 1

Last updated on Aug 18, 2018

Minor bug fixes and improvements. Install or update to the newest version to check it out!

Traduzione in caricamento...

Informazioni APP aggiuntive

Ultima versione

Richiedi aggiornamento Iot Servo Slider 1

Caricata da

โบ๊ท' น้อย

È necessario Android

Android 4.0+

Mostra Altro

Iot Servo Slider Screenshot

Commento Loading...
Lingua
Iscriviti ad APKPure
Sii il primo ad accedere alla versione anticipata, alle notizie e alle guide dei migliori giochi e app Android.
No grazie
Iscrizione
Abbonato con successo!
Ora sei iscritto ad APKPure.
Iscriviti ad APKPure
Sii il primo ad accedere alla versione anticipata, alle notizie e alle guide dei migliori giochi e app Android.
No grazie
Iscrizione
Successo!
Ora sei iscritto alla nostra newsletter.