-->
Page 1 of 2

Webserver pushbutton control

PostPosted: Fri Nov 20, 2015 3:04 pm
by zioax
I need to set up a webserver page for control a rc car, and what I would to do is just a page with 4 button, one for each command, until one of these is pressed should be executed a function, for example move the car on and back. Is this possible to do? Thanks

Re: Webserver pushbutton control

PostPosted: Fri Nov 20, 2015 3:09 pm
by martinayotte
Of course it is possible !
Simply start looking at ESP8266WebServer example.

Re: Webserver pushbutton control

PostPosted: Fri Nov 20, 2015 3:24 pm
by zioax
II took a look to the webserver sketch but I haven't found what I was looking for. Could you link me the page? Thanks

Re: Webserver pushbutton control

PostPosted: Fri Nov 20, 2015 3:55 pm
by martinayotte
The simplest WebServer example is HelloServer :

https://github.com/esp8266/Arduino/blob ... Server.ino

Of course, the buttons need to be added, but it quite simple HTML code that will do some AJAX calls which will be receive by ESP Web Server under their own path. Then, you can have server.on() for each path, one per button, and you add your motor control code inside them.