Closed rei-vilo closed 1 year ago
@rei-vilo – I'm not able to reproduce the problem using a Moddable Two. Here's a flow that changes the backlight to a random value once a second.
I run that by updating the flows.json manually and using mcconfig -d -m -p esp32/moddable_two
.
Maybe you are doing something different here?
Thank you for your answer.
As the symptoms were not new, I cleaned the build/tmp
and build/bin
sub-folders.
Everything works as expected now, except PWM seems to be reversed: 100 is dark and 0 is bright.
Everything works as expected now...
Great!
... except PWM seems to be reversed: 100 is dark and 0 is bright
Correct. The PWM on the Moddable Two backlight interprets 0 as full brightness and 100 as off. The Backlight
in the host takes care of that automatically. But here, since you are writing to the PWM directly, you need to apply the mapping. In case you aren't aware, the Node-RED Range node can do that mapping:
Cleaning the
build/tmp
andbuild/bin
sub-folders of$MODDABLE
solved the issue.Another question related to GPIOs, this time
PWM 18
in charge of backlight from Node-RED MCU.Configuration the RPI-GPIO node with
PWM 18
shows12 not available
.Trying to access
config.brightness = 75;
orbacklight.write(80);
return errors as well.The panes Configuration nodes and Context do not list this parameter or are empty.
How to manage backlight with Node-RED?
Originally posted by @rei-vilo in https://github.com/phoddie/node-red-mcu/discussions/49#discussioncomment-4402473