VLCB
Loading...
Searching...
No Matches
VLCB::LED Class Reference

class to encapsulate a non-blocking LED More...

#include <LED.h>

Public Types

enum  Mode : byte {
  Off = 0 , On = 1 , Blinking_Off = 2 , Blinking_On = 3 ,
  Pulsing = 5 , IsOn = 0x01 , IsBlinking = 0x02 , IsPulsing = 0x04
}

Public Member Functions

 LED ()
 class for individual LED with non-blocking control
 LED (byte pin, bool active=HIGH)
void setPin (byte pin, bool active=HIGH)
bool getState ()
void on ()
void off ()
void toggle ()
void blink (unsigned int rate=BLINK_RATE)
void pulse (unsigned int duration=PULSE_ON_TIME)
void run ()

Protected Member Functions

void _update ()

Protected Attributes

byte _pin
byte _mode
bool _active
unsigned int _interval
unsigned long _timer_start

Detailed Description

class to encapsulate a non-blocking LED

Member Enumeration Documentation

◆ Mode

enum VLCB::LED::Mode : byte
Enumerator
Off 
On 
Blinking_Off 
Blinking_On 
Pulsing 
IsOn 0x01 
IsBlinking 0x02 
IsPulsing 0x04 

Constructor & Destructor Documentation

◆ LED() [1/2]

VLCB::LED::LED ( )

class for individual LED with non-blocking control

◆ LED() [2/2]

VLCB::LED::LED ( byte pin,
bool active = HIGH )
explicit

Member Function Documentation

◆ setPin()

void VLCB::LED::setPin ( byte pin,
bool active = HIGH )

◆ getState()

bool VLCB::LED::getState ( )

◆ on()

void VLCB::LED::on ( )

◆ off()

void VLCB::LED::off ( )

◆ toggle()

void VLCB::LED::toggle ( )

◆ blink()

void VLCB::LED::blink ( unsigned int rate = BLINK_RATE)

◆ pulse()

void VLCB::LED::pulse ( unsigned int duration = PULSE_ON_TIME)

◆ run()

void VLCB::LED::run ( )

◆ _update()

void VLCB::LED::_update ( )
protected

Member Data Documentation

◆ _pin

byte VLCB::LED::_pin
protected

◆ _mode

byte VLCB::LED::_mode
protected

◆ _active

bool VLCB::LED::_active
protected

◆ _interval

unsigned int VLCB::LED::_interval
protected

◆ _timer_start

unsigned long VLCB::LED::_timer_start
protected

The documentation for this class was generated from the following files: