#avr | Logs for 2016-04-29

Back
[16:15:16] <Duality> hi all :)
[16:15:50] <Duality> i am reading a diode matrix my keys are being hit multiple times i am using 1n4148 diodes. and i don't know how to fix it. i am also scanning as fast as is possible :)
[16:17:29] <Lambda_Aurigae> look up debouncing.
[16:17:42] <Lambda_Aurigae> it can be done in hardware or software, depending on your implementation.
[16:17:55] <Lambda_Aurigae> I would stay and do a google search for you but I have to run.
[16:18:47] <Duality> it's a piano keyboard
[16:19:13] <Duality> it's when i hold the keys down that the multiple triggering happens
[16:22:14] <Duality> jeej
[16:22:25] <Duality> way better results waiting after i set a row
[16:22:37] <Duality> doesn't double hit anymore and it doesn't keep triggering :)
[16:24:45] <Duality> i gues the delay is to little for any human pianist to notice
[16:25:10] <Duality> a total of 40ms delay
[16:25:18] <Duality> 5 per row and 8 rows
[16:25:40] <Duality> 5ms
[16:26:48] <RikusW> Duality: a lowpass filter will help
[16:27:05] <RikusW> a simple cap might too
[16:27:11] <RikusW> or resistor and cap
[16:28:55] <Duality> so where would i place the filter in the diode matrix ? in the collumns (those are being read)
[16:29:04] <Duality> ?
[16:29:15] <Duality> sorry that had to be on the end of the sentence :)
[16:35:40] <Duality> it's a fun project i have been working on. converting one of those old electric organs to full midi :)
[16:35:52] <Duality> but it's been taking so much time ! :D
[17:09:03] <Duality> i just found this
[17:09:05] <Duality> http://www.ganssle.com/debouncing-pt2.htm
[17:09:15] <Duality> might encorporate that into my future design
[17:09:21] <Duality> it looks nice and simple
[19:52:59] <inflex> lo all
[19:54:23] <Duality> hi inflex
[19:55:04] <inflex> urrrrugh... or just debounce in software, or use a cap-resistor low-pass?
[19:57:31] <Duality> inflex: ha yea. but i was thinking maybe all this could be avoided if i use a timer to do the scanning. when entering the timer interupt i'd read first, then increment the row (rows are being scanned) that way it'll take a bit for the bouncing to stop.
[19:57:48] <Duality> but i should probably just put a scope on it to see how much bouncing there is :)
[20:07:03] <inflex> I find if you just create a debounce loop in C, it works well enough, ie, wait for 50ms and see if the button is still pressed
[20:14:56] <Duality> inflex: i try to program nonblocking so that you can keep doing things. that is why i was planning on putting that in a timer :)