513
edits
No edit summary |
No edit summary |
||
Line 110: | Line 110: | ||
'''3) hacking a toy keyboard, triggering it with relays + exploring its inner architecture''' | '''3) hacking a toy keyboard, triggering it with relays + exploring its inner architecture''' | ||
This is a common keyboard matrix with a 4 x 3 buttons number plate.<br> | |||
I „reverse engineered“ the matrix structure (hidden in the case) after I soldered pin headers to its connectors in order to plug it into the bread board.<br> | |||
<br> | |||
I was mostly interested in using the matrix as a variable resistor rather than using it as a „multiple digital pin input device“.<br> | |||
I achieved that by connecting different resistor values in between each contact of the vertical and the horizontal button lines. <br> | |||
In the end a voltage divider helped to create different voltage changes for the arduinos analog input.<br><br> | |||
This way every button represents a certain value in the analog input of the arduino.<br> | |||
By doing that I discovered a major problem: some of the values almost overlapped. In addition to the arduinos analog input pin generated quite some noise.<br> | |||
Therefore I had to define a certain range of values for each button. Although this worked a bit better there was still a lot of overlap.<br> | |||
This overlap sometimes lead to the effect that the interpretation of buttons being pressed was wrong.<br> | |||
<br> | |||
Another interesting part of that experiment was the code.<br> | |||
I did not use any library - instead of that I tried to use my basic programming skills to set it up by myself.<br> | |||
It surprisingly worked out quite well - despite the mentioned overlap problem and the face that I needed a lot of memory. <br> | |||
<br> | |||
In order to solve these issues in the future I need to learn about programming „arrays“ and „for-loops“ that can help minimizing the amount of code.<br> | |||
The overlap problem could be solved by using binary functions / average measurements that define clearer value states.<br><br> | |||
[[File:matrix_sketch_1.jpg]]<br><br> | [[File:matrix_sketch_1.jpg]]<br><br> | ||
[[File:matrix_ardu_1.jpg]]<br><br> | [[File:matrix_ardu_1.jpg]]<br><br> |
edits