An Arduino Library for LED Control
- Download the .zip file of the latest release.
- In the Arduino IDE, go to Sketch > Include Library > Add .ZIP Library....
- Select the downloaded .zip file.
To update the library:
- Delete the existing FelixTheCatLED folder from your libraries directory: Documents > Arduino > libraries > FelixTheCatLED
- Follow the installation steps above to install the latest version.
#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 = brightness + step;
if (brightness <= 0 || brightness >= 255) {
step = -step;
}
delay(30);
}