SethSenpai / singleLEDLibrary

A non interrupting lighting library for single LED's
12 stars 10 forks source link

LED are too dim when using analog write #11

Open spuder opened 2 years ago

spuder commented 2 years ago

Thank you for this library. It works perfectly, however the LEDs never seem to get above 50% brightness

#include <singleLEDLibrary.h>
sllib redLed(6);
sllib greenLed(9);
sllib blueLed(10);

void setup() {
  redLed.setOnSingle();
  blueLed.setOffSingle();
  greenLed.setOffSingle();

}

void loop() {
//    redLed.breathSingle(1200);
//    greenLed.breathSingle(1200);
//    blueLed.breathSingle(1200);
}

I suspect what is happening is that digitalWrite range is 0-100 whereas analogWrite range is 0-255.

Here is my setup