An Arduino Library for LED Control
- Download the library .zip file from the latest release.
- In the Arduino IDE, go to
Sketch>Include Library>Add .ZIP Library.... - Select the downloaded .zip file.
#include <FelixTheCatLED.h>
#define LED_PIN 6
FelixTheCatLED::LED led(LED_PIN);
void setup() {
led.begin();
}
void loop() {
led.on();
delay(1000);
led.off();
delay(1000);
}#include <FelixTheCatLED.h>
#define LED_PIN 3 // Choose a PWM Pin denoted by ~
FelixTheCatLED::PWM led(LED_PIN);
int brightness = 0;
int step = 1;
void setup() {
led.begin();
}
void loop() {
led.setBrightness(brightness);
brightness += step;
if (brightness <= 0 || brightness >= 255) {
step = -step; // Reverse direction at limits
delay(100); // Add a small delay for visibility
}
delay(10);
}