commit
This commit is contained in:
parent
183ab102f2
commit
8ac9dac055
5 changed files with 55 additions and 2 deletions
4
web.lua
4
web.lua
|
@ -1,3 +1,7 @@
|
||||||
|
dofile("buzz.lua")
|
||||||
|
-- s = sensor.attach("DHT22", pio.GPIO21)
|
||||||
|
-- tmr.delayms(500)
|
||||||
|
nets = net.wf.scan(true)
|
||||||
nb = 0
|
nb = 0
|
||||||
net.wf.setup(net.wf.mode.AP, "ESP32 Pierre", "sandwich134")
|
net.wf.setup(net.wf.mode.AP, "ESP32 Pierre", "sandwich134")
|
||||||
net.wf.start()
|
net.wf.start()
|
||||||
|
|
8
www/buzz.lua
Normal file
8
www/buzz.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<?lua
|
||||||
|
buzz(pio.GPIO21, 1000)
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
@ -10,5 +10,29 @@
|
||||||
console(nb.." Chargements")
|
console(nb.." Chargements")
|
||||||
print(nb.." Chargements")
|
print(nb.." Chargements")
|
||||||
?>
|
?>
|
||||||
|
<h1>DHT22</h1>
|
||||||
|
<?lua
|
||||||
|
-- print("Temp: "..s:read("temperature").." Humi: "..s:read("humidity"))
|
||||||
|
?>
|
||||||
|
<h1>Led</h1>
|
||||||
|
<iframe name="fd" style="display:none"></iframe>
|
||||||
|
<form action="ledon.lua" target="fd">
|
||||||
|
<button type="submit">On</button>
|
||||||
|
</form>
|
||||||
|
<form action="ledoff.lua" target="fd">
|
||||||
|
<button type="submit">Off</button>
|
||||||
|
</form>
|
||||||
|
<h1>Buzzer</h1>
|
||||||
|
<form action="buzz.lua" target="fd">
|
||||||
|
<button type="submit">Buzz</button>
|
||||||
|
</form>
|
||||||
|
<h1>Networks</h1>
|
||||||
|
<ul>
|
||||||
|
<?lua
|
||||||
|
for i=0,#nets do
|
||||||
|
print("<li>"..nets[i].ssid.."</li>")
|
||||||
|
end
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
8
www/ledoff.lua
Normal file
8
www/ledoff.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<?lua
|
||||||
|
ledoff()
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
9
www/ledon.lua
Normal file
9
www/ledon.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<?lua
|
||||||
|
ledon()
|
||||||
|
?>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue