Set Gpio mode to output before changing it
This commit is contained in:
parent
b9b8253adc
commit
1e20d8a397
@ -72,8 +72,8 @@ void handleGpio() {
|
||||
return;
|
||||
}
|
||||
|
||||
digitalWrite(server.arg("gpio").toInt(), server.arg("value").toInt());
|
||||
pinMode(server.arg("gpio").toInt(), OUTPUT);
|
||||
digitalWrite(server.arg("gpio").toInt(), server.arg("value").toInt());
|
||||
server.send(200, "text/html", "<h1>GPIO" + server.arg("gpio") + " changed to " + server.arg("value") + "</h1>");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user