If this is possible, can you give a short example of code for maybe one button just to see how it is done?
Thanks!!!!!
Explore... Chat... Share...
Moderator: Mmiscool
memclear
cls
' this is the default value for pwm out
pdef = 512
' this is the pin defined as pwm output
pwo 13 pdef
' this is the slider
wprint |<input type="range" id="dimmer" oninput="setPWM()" onclick="setPWM()" min="0" max="1023" value="| & pdef & |"/>|
'this is the javascript "ajax" code
fun$ = |function setPWM() {|
fun$ = fun$ & |lum=document.getElementById("dimmer").value;|
fun$ = fun$ & |window.event.returnValue = false;|
fun$ = fun$ & |var xmlHttp = new XMLHttpRequest();|
fun$ = fun$ & |xmlHttp.open("GET", "msg?pwm=" + lum, false);|
fun$ = fun$ & |xmlHttp.send(null);|
fun$ = fun$ & |return xmlHttp.responseText;}|
' this is where the code is inserted into the html
wprint "<script>" & fun$ & "</script>"
'this is where the prog will jump on slider change
msgbranch [message]
wait
[message]
msgget "pwm" mess
'uncomment this line to see the value received
'serialprintln mess
pwo 13 mess
wait
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]