The diodes shoud be reversed (RBx=0 at switch read then) or 10k should be pull down and not pull up, otherwise you will not detect pressed button.<br />Let's not get crazy with series diode with LED, most LEDs will be OK even at higher reverse voltage. And you can always go down with supply voltage to be safer.<br />If you want to drive 5 LEDs in a single row from one RBx pin pulled low, that's about 15mA, and definitely RBx will not be at 0V anymore then, but maybe 0.5V or more. That may result in varying brightness depending how many LEDs are on in a row. 5 transistors will fix that. That is irrelevant of course if you plan to light only one of 20 at a time.<br /><br />Roman<br /><br /><br />Dnia 7 października 2015 15:52 Jean-Pierre Desrochers <jpdesroc@oricom.ca> napisał(a):<br /><br />
<blockquote style="font-size: 12px; padding-left: 1em; margin-left: 1em; margin-bottom: 0px; border-left: #ccc 2px solid;">I'm about to build a MIDI foot controller<br />using around 20 normally open footswitches<br />with there respective state LEDs.<br />I have a bunch of PIC16F88 micros and want<br />to use one for this project using as less pins as possible.<br />(9 pins for the matrix)<br />I figured out a way to read and feed all switches<br />and LEDs this way:<br /><br />http://www.arcenson.com/public/PIC16F88_5x4_matrix.JPG<br /><br />All the switches and LEDs will be processed one after each other<br />in an endless loop..<br />RB5 will send the MIDI data.<br /><br />Does anybody see something I forgot in that drawing ?<br />I'm not home and will try it tonight.<br /><br />Thanks. JP<br />_______________________________________________<br />Synth-diy mailing list<br />Synth-diy@dropmix.xs4all.nl<br />http://dropmix.xs4all.nl/mailman/listinfo/synth-diy</blockquote>
<br /><br />