MIDI Elements
Library to simplify handling of components for MIDI controllers
 All Classes Files Functions Variables Macros
Led Class Reference

Class for handling single color LEDs. More...

#include <Led.h>

Public Member Functions

 Led (byte p)
 constructor with pin number. More...
 
 Led (byte p, byte c, byte n)
 constructor with pin number, midi channel and midi note. More...
 
 Led (byte p, byte c, byte n, bool a)
 constructor with pin number, midi channel, midi note and pwm. More...
 
 ~Led ()
 
void setOn (byte c, byte n, byte v)
 read the values for note on and cc and update the led state. if the passed channel and number match the the led state is set to v More...
 
void setOff (byte c, byte n, byte v)
 read the values for note off and update the led state. More...
 
void setOnSilent (byte c, byte n, byte v)
 read the values for note on and cc, but do not update the led state. (used for banked LEDs). More...
 
void setOffSilent (byte c, byte n, byte v)
 read the values for note off, but do not update the led state. More...
 
void set (bool s)
 manually set the state, but does not update the LED. More...
 
void set ()
 manually update the LED to the set state (used for banked LEDs) More...
 

Detailed Description

Class for handling single color LEDs.

Enable PWM, to set the brightness through velocity or CC, must be on PWM pin.

Constructor & Destructor Documentation

Led::Led ( byte  p)

constructor with pin number.

Parameters
ppin number
Led::Led ( byte  p,
byte  c,
byte  n 
)

constructor with pin number, midi channel and midi note.

Parameters
ppin number
cmidi channel
ncc number or note
Led::Led ( byte  p,
byte  c,
byte  n,
bool  a 
)

constructor with pin number, midi channel, midi note and pwm.

Parameters
ppin number
cmidi channel
ncc number or note
aenable PWM
Led::~Led ( )

Member Function Documentation

void Led::set ( bool  s)

manually set the state, but does not update the LED.

Parameters
starget state
void Led::set ( )

manually update the LED to the set state (used for banked LEDs)

void Led::setOff ( byte  c,
byte  n,
byte  v 
)

read the values for note off and update the led state.

Parameters
cchannel from callback function
nnote or cc number from callback function
vvalue or velocity from callback function
void Led::setOffSilent ( byte  c,
byte  n,
byte  v 
)

read the values for note off, but do not update the led state.

Parameters
cchannel from callback function
nnote or cc number from callback function
vvalue or velocity from callback function
void Led::setOn ( byte  c,
byte  n,
byte  v 
)

read the values for note on and cc and update the led state. if the passed channel and number match the the led state is set to v

Parameters
cchannel from callback function
nnote or cc number from callback function
vvalue or velocity from callback function
void Led::setOnSilent ( byte  c,
byte  n,
byte  v 
)

read the values for note on and cc, but do not update the led state. (used for banked LEDs).

Parameters
cchannel from callback function
nnote or cc number from callback function
vvalue or velocity from callback function

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