|
MIDI Elements
Library to simplify handling of components for MIDI controllers
|
Class for handling tri color LEDs. More...
#include <RGBLed.h>
Public Member Functions | |
| RGBLed (byte pa, byte pb, byte pc) | |
| constructor with pin number for red, green and blue. More... | |
| RGBLed (byte pa, byte pb, byte pc, byte c, byte n) | |
| constructor with pin number for red, green, blue, midi channel and midi note. More... | |
| RGBLed (byte pa, byte pb, byte pc, byte c, byte n, bool a) | |
| constructor with pin number for red, green, blue, midi channel, midi note and PWM. More... | |
| ~RGBLed () | |
| 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 b, byte i) |
| set the default on color manually. this color will be enabled if the value 127 is received. More... | |
Class for handling tri 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.
| RGBLed::RGBLed | ( | byte | pa, |
| byte | pb, | ||
| byte | pc | ||
| ) |
constructor with pin number for red, green and blue.
| pa | red led pin number |
| pb | green led pin number |
| pc | blue led pin number |
| RGBLed::RGBLed | ( | byte | pa, |
| byte | pb, | ||
| byte | pc, | ||
| byte | c, | ||
| byte | n | ||
| ) |
constructor with pin number for red, green, blue, midi channel and midi note.
| pa | red led pin number |
| pb | green led pin number |
| pc | blue led pin number |
| c | midi channel |
| n | midi note or cc number |
| RGBLed::RGBLed | ( | byte | pa, |
| byte | pb, | ||
| byte | pc, | ||
| byte | c, | ||
| byte | n, | ||
| bool | a | ||
| ) |
constructor with pin number for red, green, blue, midi channel, midi note and PWM.
| pa | red led pin number |
| pb | green led pin number |
| pc | blue led pin number |
| c | midi channel |
| n | midi note or cc number |
| a | enable PWM |
| RGBLed::~RGBLed | ( | ) |
| void RGBLed::set | ( | byte | s | ) |
manually set the state, but does not update the LED.
| s | target state |
| void RGBLed::set | ( | ) |
manually update the LED to the set state (used for banked LEDs)
| void RGBLed::setColor | ( | byte | r, |
| byte | g, | ||
| byte | b, | ||
| byte | i | ||
| ) |
set the default on color manually. this color will be enabled if the value 127 is received.
| r | amount of red color |
| g | amount of green color |
| b | amount of blue color |
| i | intensity amount for the non default colors |
| void RGBLed::setOff | ( | byte | c, |
| byte | n, | ||
| byte | v | ||
| ) |
read the values for note off and update the led state.
| c | channel from callback function |
| n | note or cc number from callback function |
| v | value or velocity from callback function |
| void RGBLed::setOffSilent | ( | byte | c, |
| byte | n, | ||
| byte | v | ||
| ) |
read the values for note off, but do not update the led state.
| c | channel from callback function |
| n | note or cc number from callback function |
| v | value or velocity from callback function |
| void RGBLed::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
| c | channel from callback function |
| n | note or cc number from callback function |
| v | value or velocity from callback function |
| void RGBLed::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).
| c | channel from callback function |
| n | note or cc number from callback function |
| v | value or velocity from callback function |