roberto Posted January 25, 2018 Report Posted January 25, 2018 Hi After testing the functionality of the CORE, DINs and DOUTs it’s time to layout the Controller. I want to use (among others) 16 RGB Buttons and im unsure how to connect it to the DOUT’s. I read some threads about it but didn’t found the answer that satisfied me. http://midibox.org/forums/topic/18058-connecting-rgb-leds/?page=1 http://midibox.org/forums/topic/19752-rgb-hue-sweep/#comment-171871 The RGB Buttons are COMMON ANODE. One possibility is to attach it to a 6 *8 LED Matrix with the drawback to loose brightness. I don’t want that, I have enough DOUTs to connect the LEDs directly, so I would like to go the direct way. Is it possible to do that without using additional ULN Arrays? As I understand it is possible to drive one RGB LED with one Midi Note and make the color with different velocities right? And since I am at the very beginning of everything I don’t understand how the code should look for that... Quote
latigid on Posted January 25, 2018 Report Posted January 25, 2018 For common anode, wire the anode to +5V or your supply voltage (possibly through a resistor) and connect your cathodes to DOUT pins. If the light output is different for each die, you may want three resistors on the cathode side instead. E.g. red has a lower Vf, so may end up brighter, often green is too bright etc., so control the current with the resistors. 595s can sink current, meaning they "can provide ground/0V." So the output is "inverted" for common anode parts. This can be specified in MB_NG. When the 595 output is high, the LED is off. When it's low, the LED is on. You shouldn't need any transistors if the current is nominally around 20mA or so. I haven't tried with the dim levels of normal RGB LEDs, but TK. has in your second link above. Quote
roberto Posted January 25, 2018 Author Report Posted January 25, 2018 cool, thanks latigit, works... as i understand following code inverts the output: EVENT_LED id=0 inverted=1 EVENT_LED id=1 inverted=1 EVENT_LED id=2 inverted=1 etc. now i have to figure out how to assign the RGB LEDs to different velocities on the same note... phew, this coding is a big book to get into it... the RGB button has internal resistors, so i think it's not necessary to match the color brightness... Quote
latigid on Posted January 26, 2018 Report Posted January 26, 2018 Quote the RGB button has internal resistors, so i think it's not necessary to match the color brightness... Perfect, even easier then! Good choice on the buttons. 6 hours ago, roberto said: now i have to figure out how to assign the RGB LEDs to different velocities on the same note... phew, this coding is a big book to get into it... It does take a while to understand the coding, but just go through the many examples. Notice in the "RGB hue sweep" thread, TK. has basically what you need. He uses a map to define the LED colour based on an incoming CC, so change that to notes over the range you require. The velocity should change the dim level, at least this is one way to work with "smart" LEDs. Quote
roberto Posted January 27, 2018 Author Report Posted January 27, 2018 yes, those are nice buttons, rugged, but 10 bucks each... well, before fiddling with RGB hue, i have to solve following by inverting i turn off the RGBLEDs on startup: # Common Anode RGB LEDs EVENT_LED id=1 inverted=1 type=NoteOn key=36 # Red LED EVENT_LED id=2 inverted=1 type=NoteOn key=37 # Green LED EVENT_LED id=3 inverted=1 type=NoteOn key=38 # Blue Led by sending a NoteOn 36/37/38 and Off from the MIOS Keyboard i can light and turn off the 3 LEDs. Fine. Now, when i define a button the behaviour is reversed EVENT_BUTTON id=81 fwd_id=LED:1 type=NoteOn key=36 range=0:127 button_mode=Toggle EVENT_BUTTON id=82 fwd_id=LED:2 type=NoteOn key=37 range=0:127 button_mode=Toggle EVENT_BUTTON id=83 fwd_id=LED:3 type=NoteOn key=38 range=0:127 button_mode=Toggle will say, the LEDs are OFF when the button sends a NoteOn and ON by a NoteOff... i tried to inverse also the EVENT_BUTTON and the range (127:0) but nothing helps... is there something else i need to invert? i don't get it. Quote
roberto Posted January 27, 2018 Author Report Posted January 27, 2018 strange... i booted the whole thing on a second computer and now it's working as expected... will investigate... Quote
roberto Posted January 27, 2018 Author Report Posted January 27, 2018 switched back to first comuter, and there it is again... button behaviour inversed again, damned... Quote
roberto Posted February 7, 2018 Author Report Posted February 7, 2018 ...just for the record. im slowly slowly get into the deep sea of MIOS... i managed to map the RGB buttons with the multicolour test mentioned in TK's post above. everything's fine... (although magenta is missing in the map, i added it at the end after red...) back to construction Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.