1

Topic: code for smooth fading of led

Hello,
I don't seam to be able do get a smooth fading of a led from off to fully on using the slider. i use a wemos d1 mini. Is this not possible to do? if so, what code can i implement for this?

2

Re: code for smooth fading of led

david wrote:

Hello,
I don't seam to be able do get a smooth fading of a led from off to fully on using the slider. i use a wemos d1 mini. Is this not possible to do? if so, what code can i implement for this?

The interface is not as fast as it could be, so new values come in in larger jumps than is desirable.

You could try implementing a first-order filtering or smoothing algorithm, the maths is simple...

FV=FV+C(NV-FV)

Where:
FV= Filtered value
C= constant (range 0-1) The smaller the number the more dampening.
NV= New Value

2B, or not 2B, that is the pencil ...