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

Class for handling bi color LEDs. More...

#include <RGLed.h>

Public Member Functions

 RGLed (byte pa, byte pb)
 constructor with pin number for red and green. More...
 
 RGLed (byte pa, byte pb, byte c, byte n)
 constructor with pin number for red, green, midi channel and midi note. More...
 
 RGLed (byte pa, byte pb, byte c, byte n, bool a)
 constructor with pin number for red, green, midi channel, midi note and pwm. More...
 
 ~RGLed ()
 
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 (byte 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...
 
void setColor (byte r, byte g, byte i)
 set the default on color manually. this color will be enabled if the value 127 is received. More...
 

Detailed Description

Class for handling bi color LEDs.

Enable PWM, to set the brightness through velocity or CC, must be on PWM pin and there will be no ability to change colors through velocity values. Default color will be active if velocity 127 is recieved. For any other values colours will cycle through. Intensity will change the PWM write value for different colors.

Constructor & Destructor Documentation

RGLed::RGLed ( byte  pa,
byte  pb 
)

constructor with pin number for red and green.

Parameters
pared led pin number
pbgreen led pin number
RGLed::RGLed ( byte  pa,
byte  pb,
byte  c,
byte  n 
)

constructor with pin number for red, green, midi channel and midi note.

Parameters
pared led pin number
pbgreen led pin number
cmidi channel
nmidi note or cc number
RGLed::RGLed ( byte  pa,
byte  pb,
byte  c,
byte  n,
bool  a 
)

constructor with pin number for red, green, midi channel, midi note and pwm.

Parameters
pared led pin number
pbgreen led pin number
cmidi channel
nmidi note or cc number
aenable PWM
RGLed::~RGLed ( )

Member Function Documentation

void RGLed::set ( byte  s)

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

Parameters
starget state
void RGLed::set ( )

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

void RGLed::setColor ( byte  r,
byte  g,
byte  i 
)

set the default on color manually. this color will be enabled if the value 127 is received.

Parameters
ramount of red color
gamount of green color
iintensity amount for the non default colors
void RGLed::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 RGLed::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 RGLed::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 RGLed::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: