control arduino from website

Solutions on MaxInterview for control arduino from website by the best coders in the world

showing results for - "control arduino from website"
Isis
10 Oct 2017
1if (header.indexOf("LED0=ON") != -1) 
2{
3Serial.println("GPIO23 LED is ON");
4LED_ONE_STATE = "on";
5digitalWrite(GPIO_PIN_NUMBER_22, HIGH);
6} 
7if (header.indexOf("LED0=OFF") != -1) 
8{
9Serial.println("GPIO23 LED is OFF");
10LED_ONE_STATE = "off";
11digitalWrite(GPIO_PIN_NUMBER_22, LOW);
12} 
13if (header.indexOf("LED1=ON") != -1)
14{
15Serial.println("GPIO23 LED is ON");
16LED_TWO_STATE = "on";
17digitalWrite(GPIO_PIN_NUMBER_23, HIGH);
18}
19if (header.indexOf("LED1=OFF") != -1) 
20{
21Serial.println("GPIO23 LED is OFF");
22LED_TWO_STATE = "off";
23digitalWrite(GPIO_PIN_NUMBER_23, LOW);
24}
25if (header.indexOf("LED2=ON") != -1) 
26{
27Serial.println("GPIO15 LED is ON");
28LED_THREE_STATE = "on";
29digitalWrite(GPIO_PIN_NUMBER_15, HIGH);
30}
31if(header.indexOf("LED2=OFF") != -1) {
32Serial.println("GPIO15 LED is OFF");
33LED_THREE_STATE = "off";
34digitalWrite(GPIO_PIN_NUMBER_15, LOW);
35}
Christian
11 Apr 2019
1<!DOCTYPE html> 
2<html> 
3<head>
4<style>
5.button {
6background-color: #4CAF50;
7border: 2px solid #4CAF50;;
8color: white;
9padding: 15px 32px;
10text-align: center;
11text-decoration: none;
12display: inline-block;
13font-size: 16px;
14margin: 4px 2px;
15cursor: pointer;
16}
17</style>
18</head>
19<body> 
20<center><h1 style="color:blue;">ESP32 Web server LED controlling example</h1></center> 
21<center><h2 style="color:black;">Web Server Example Microcontrollerslab.com</h2></center> 
22<center><h2 style="color:Green;">Press "ON" button to turn on led and "OFF" button to turn off LED</h3></center> 
23<form> 
24<center>
25<button class="button" name="LED0" value="ON" type="submit">LED0 ON</button> 
26<button class="button" name="LED0" value="OFF" type="submit">LED0 OFF</button><br><br> 
27<button class="button" name="LED1" value="ON" type="submit">LED1 ON</button> 
28<button class="button" name="LED1" value="OFF" type="submit">LED1 OFF</button> <br><br>
29<button class="button" name="LED2" value="ON" type="submit">LED2 ON</button> 
30<button class="button" name="LED2" value="OFF" type="submit">LED2 OFF</button> 
31</center>
32</form> 
33</body> 
34</html>