MIDI Elements
Library to simplify handling of components for MIDI controllers
 All Classes Files Functions Variables Macros
RGLed.h
Go to the documentation of this file.
1 // MIDI Elements LED class
2 // Library to simplify handling of components for MIDI controllers
3 // Created by Tomash Ghz
4 // www.tomashg.com
5 // ghz.tomash@gmail.com
6 
7 #ifndef RGLed_H
8 #define RGLed_H
9 
10 //-----------------------------------------------------------------------------------
11 #include "WProgram.h" //It is very important to remember this! note that if you are using Arduino 1.0 IDE, change "WProgram.h" to "Arduino.h"
12 
20 class RGLed {
21 private:
22  byte pinA; // pin on teensy
23  byte pinB; // pin on teensy for second color
24  byte channel; // midi channel
25  byte number; // midi number
26  byte red;
27  byte green;
28  byte intensity; // intensity value for pwm
29  bool pwm;
30  byte state;
31 public:
32  RGLed(byte pa, byte pb);
33  RGLed(byte pa, byte pb, byte c, byte n);
34  RGLed(byte pa, byte pb, byte c, byte n, bool a);
35  ~RGLed(); // destructor
36  void setOn(byte c, byte n, byte v);
37  void setOff(byte c, byte n, byte v);
38  void setOnSilent(byte c, byte n, byte v);
39  void setOffSilent(byte c, byte n, byte v);
40  void set(byte s);
41  void set();
42  void setColor(byte r, byte g, byte i);
43 };
44 //-----------------------------------------------------------------------------------
45 
46 #endif
void setOff(byte c, byte n, byte v)
read the values for note off and update the led state.
Definition: RGLed.cpp:71
Class for handling bi color LEDs.
Definition: RGLed.h:20
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)...
Definition: RGLed.cpp:79
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...
Definition: RGLed.cpp:129
void set()
manually update the LED to the set state (used for banked LEDs)
Definition: RGLed.cpp:102
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 t...
Definition: RGLed.cpp:37
void setOffSilent(byte c, byte n, byte v)
read the values for note off, but do not update the led state.
Definition: RGLed.cpp:92
RGLed(byte pa, byte pb)
constructor with pin number for red and green.
Definition: RGLed.cpp:11
~RGLed()
Definition: RGLed.cpp:34