I just got the GrovePi+ and am trying to make the led_fade program in NodeJS, as I am slightly more comfortable with it than with python. I however cannot find a way to change the LED’s brightness. I did find one thing in the documentation that might help, but I don’t have a clue how to utilize it.
- write(value) - Write a value on the sensor/component
I think this could be used to set the brightness but I haven’t figured it out yet.
Thanks in advance and have a wonderful day!
Edit: After some research, I discovered what I should’ve already known. The write function takes one parameter: when it’s 0, the led turns off, and when it’s 1, it turns the led off. Any number values below 1 result in it turning itself off and any above 1 result in turning on. So when I put .6 it doesn’t change brightness it just turns off.