Hello everybody,
I run current ESP Easy on a NodeMCU (LoLin V3) with an DHT22 and a 0,96 OLED connected. Everything works fine so far.
I am able to set the display contrast through the web interface.
Now it would be great, if I am able to connect a switch which goes through the states (i.e. "On/hight contr."; "On/medium contr."; "On/low contr."; "Off").
Since I am a newbie I need to ask if such is possible at all and, if yes how to do it.
Thanks for all help
/Mav
ESP Easy 0.96" OLED set contrast with a button on NodeMCU
Moderators: grovkillen, Stuntteam, TD-er
Re: ESP Easy 0.96" OLED set contrast with a button on NodeMCU
Yes, it is possible at all, pretty easy using the rules functionality of espeasy.
Sorry, at this daytime I'm too tired to post a detailed example using a button, just a short example how to set the contrast depending on daytime:
Probably it might help to have a look at https://www.letscontrolit.com/wiki/inde ... rial_Rules
Before being able to use the rules you have to enable it in Tools/Advanced
Sorry, at this daytime I'm too tired to post a detailed example using a button, just a short example how to set the contrast depending on daytime:
Code: Select all
On Clock#Time=All,21:00 do
OLEDFRAMEDCMD,low
endon
On Clock#Time=All,19:00 do
OLEDFRAMEDCMD,medium
endon
On Clock#Time=All,08:00 do
OLEDFRAMEDCMD,medium
endon
On Clock#Time=All,9:30 do
OLEDFRAMEDCMD,high
endon
Before being able to use the rules you have to enable it in Tools/Advanced
Code: Select all
pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $
Re: ESP Easy 0.96" OLED set contrast with a button on NodeMCU
Thank you so much!
It is working!!
So now I am facing next challenge:
Am I able to find the current setting on contrast?
This is because I like to use the push button to toggle between the states (on-high; on-med; on-low; off).
Therefore I need to know the current state to choose the one I like to fire.
Thanks again!
/Mav63
It is working!!
So now I am facing next challenge:
Am I able to find the current setting on contrast?
This is because I like to use the push button to toggle between the states (on-high; on-med; on-low; off).
Therefore I need to know the current state to choose the one I like to fire.
Thanks again!
/Mav63
Re: ESP Easy 0.96" OLED set contrast with a button on NodeMCU
Solved with a Dummy device...
But need to press push button sometimes multiple time to get effect.
My rules:
I do not evaluate Value of 3 because having Dummy set to 1 in all other cases than 1 or 2.
The interval of Dummy device is set to 1 sec. and of OLED device to 5 sec. which lowers the amount of pressing push button in short time to get result.
Any idea to get a (not) each click get a result issue?
Thanks!
/Mav
But need to press push button sometimes multiple time to get effect.
My rules:
Code: Select all
On Button#Switch=toggle do
IF [Dummy#Wert1]=1
OLEDFRAMEDCMD,medium
TaskValueSet 4,1,2
ELSE
IF [Dummy#Wert1]=2
OLEDFRAMEDCMD,high
TaskValueSet 4,1,3
ELSE
OLEDFRAMEDCMD,low
TaskValueSet 4,1,1
ENDIF
ENDIF
endon
The interval of Dummy device is set to 1 sec. and of OLED device to 5 sec. which lowers the amount of pressing push button in short time to get result.
Any idea to get a (not) each click get a result issue?
Thanks!
/Mav
Who is online
Users browsing this forum: Ahrefs [Bot] and 8 guests