General area when it fits no where else

Moderator: Mmiscool

User avatar
By Mmiscool
#49031 In version 3 with web sockets gui slider events can be captured almost instantly.

run this program on a node mcu. slide the slider and see the LED change almost instantly.

Code: Select allslider x, 0, 1020
timer 500, [set.pwm]
wait

[set.pwm]
io(pwo,d4,x)
wait
User avatar
By forlotto
#49065 Sweet maybe later tonight I will load basic 3.0 and give it a shot excellent I knew websockets was able to do it but the how was beyond me the method of invoking websockets I thought would be a bit more of a learning curve than such simple code it appears as if websockets is just going to do its thing for you.

A rather interesting proposition this brings about a whole new set of ideas.

Man basic is untouchable it is the best developed esp8266 software on the net right now once all the bugs get sorted out I don't believe there is much that is not possible with basic.

Can you think of any bases that are not covered that you can still cover in future upgrades? I really can't other than hardware support I believe software support is pretty much licked. With the exception of like noip or something like this for your device. I'm sure there are a couple of things maybe but really basic is all hands on deck right now!

Great job!
User avatar
By forlotto
#49440 After testing results:

Your slider example is actually not a workable solution for dimming lighting.

You do not want a pulse of power every .5 seconds because it looks as if you the light is about to lose power and there is a constant fluctuation very horrible situation I would not suggest this example for any lighting this is where a giant issue comes in that I was trying to avoid.

I suppose the only way to do it via basic is with a button.

Otherwise I will need html ajax example kind of a bummer the way ajax solves this problem is that it has what is called an on click event.

Is it possible to have an on click event for a basic slider? This would eliminate the need for a button and a timer?

On click events would likely be useful in other areas as well I am not sure of what off of the top of my head but I could see the timer solution going badly for other things as well not to mention you are essentially hammering the circuit every .5 seconds.

Tried a button:
Code: Select allwprint "Dim Light:  BRIGHT"
slider x, 500, 830
wprint "DIM"
button "SET", [set.pwm]
wait

[set.pwm]
io(pwo,14,x)
wait



After hammering my lights every .5 seconds they no longer appear to dim as well as they did previous to this there is 1/3 of the lower range that now flickers in my light bulbs still ok for my needs but just saying. I will note I did not verify if it was a range issue with v3 basic or whatever...

I am a bit curious but what does pwmfreq do could I help the flicker by adjusting the frequency?