RGB Status LED Arduino Library

Examples

#include "StatusLED.h"

#define SHOW_STATUS_LED_BUTTON_PIN  3

#define RED                         0xFF0000
#define GREEN                       0x00FF00
#define BLUE                        0x000000
#define YELLOW                      0xFFFF00

/* Led pins (PWM)
 *  Red - pin 2
 *  Green - pin 3
 *  Blue - pin 4
 */
StatusLED statusLED(4, 5, 6);

void setup() {
  pinMode(SHOW_STATUS_LED_BUTTON_PIN, OUTPUT);
  attachInterrupt(digitalPinToInterrupt(SHOW_STATUS_LED_BUTTON_PIN), showStatusLED, RISING);
}

void loop() {
  statusLED.setColor(RED, false);
  statusLED.loop();
}

void showStatusLED()
{
  statusLED.turnOn();
}

Download (status-led-library.zip)

How to Install a Library

 

GitHub Repository: https://github.com/ricardosequeira/StatusLED-Arduino-Library

You may also like...

Deixe uma resposta

O seu endereço de email não será publicado. Campos obrigatórios marcados com *