# PCF9685 Dimmen slow

**URL:** <https://discourse.nodered.org/t/pcf9685-dimmen-slow/2731>\
**Category:** General\
**Created:** [31 August 2018 16:33 UTC](https://discourse.nodered.org/t/pcf9685-dimmen-slow/2731 "2018-08-31T16:33:25Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [31 August 2018 19:54 UTC](https://discourse.nodered.org/t/pcf9685-dimmen-slow/2731/5 "2018-08-31T19:54:27Z")

</div>

This sounds like an interesting little "smoothing" problem to solve...

Essentially, you have two (possibly) different light level values: the current level (of the light) and the target level (as defined by the slider). You also have some desired max change rate when moving from the current level to the target level. Sounds like a PID or PWM node to me -- but I only recognize that because of what I've learned from [this recent discussion thread](https://discourse.nodered.org/t/ds18b20-smoothing-and-pid-tuning/1015/27) between Charles and Colin on how to control the brewing process. So I'd be really interested to hear from them whether similar techniques would work in this situation.

I guess my simple-minded approach would be to have a function node with the 2 input topics (current and target), which outputs either a `current + 1` or `current - 1` value depending on whether the target was higher or lower than the current value. Feed that into a delay node and then back to the input of the function node. When the two values are the same, there would be no output.

---

_[View the full topic](https://discourse.nodered.org/t/pcf9685-dimmen-slow/2731)._
