- Sun Jun 19, 2016 1:22 pm
#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?