/LEDDriver

Primary LanguageC++MIT LicenseMIT

LEDDriver PWM for Arduino

GitHub release GitHub commits

Arduino library for controlling standard LEDs using pwm for duty cycling.

LEDDriver provides an easy approach to controlling LEDs using built in PWM functionality. LEDDriver is used much like other libraries for Arduino.

Example

// Create the LED instance and the Hardware Abstration Layer driver
LEDDriver LED;
PWMDriver *hal = new PWMDriver();

// Attach led on pin LED_BUILTIN to channel
hal->attach(LED_BUILTIN, 0);
// Start and initialize the LED libray
LED.begin(hal);
// Set the led attached to channel 0 to full duty cycle (on)
LED.set(0, 255);
// Set the led attached to channel 0 to half duty cycle (faded)
LED.set(0, 128);

Included examples

...and many more. Check out the examples folder.

PlatformIO

This library has also been pulished on PlatformIO and is available through PlatformIO's library management.