Author Topic: Help with a teensy macropad  (Read 1538 times)

0 Members and 1 Guest are viewing this topic.

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Help with a teensy macropad
« on: Tue, 21 January 2020, 01:35:34 »
Hey! I'm making a 3x3 media keys macropad with Teensy 3.2 as a project for trade school. I'm almost finished but I've ran into a problem. I'm getting incorrect inputs. The teensy seems to be reading the button I press and the buttons above it, even if I don't press those at that time. On the middle row its pretty rare but on the bottom row I get it on every press. So for example if I press button 4, it may also register button 1 as pressed and so it will both go to the previous song and reduce the volume, and on button 7 it always acts as if I pressed both 4 and 1. The bottom row is configured as joystick buttons because i plan on adding functionality with autohotkey later so they shouldnt do anything at this point right?

I'm using Bertruss's code from here https://github.com/Bertruss/MM-Macro-Pad with some tiny adjustments for my build, namely the pins which are 0, 1, 2 for columns and 3,4,5 for rows. I wired the pad following BrownFox's guide. I'm using cherry blue switches and 1n4148 diodes. Any help would be appreciated as I'm completely lost. Thanks.

Offline piit79

  • Posts: 259
Re: Help with a teensy macropad
« Reply #1 on: Tue, 21 January 2020, 02:29:58 »
I think the most probable reason for this is that there's a short somewhere. Go over your wiring carefully with a multimeter.

Also, for just 9 keys I wouldn't use matrix - you would only need 9 pins to attach all the switches directly. That would save you the diodes.

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Re: Help with a teensy macropad
« Reply #2 on: Tue, 21 January 2020, 04:18:07 »
I think the most probable reason for this is that there's a short somewhere. Go over your wiring carefully with a multimeter.

Also, for just 9 keys I wouldn't use matrix - you would only need 9 pins to attach all the switches directly. That would save you the diodes.
I checked all the connections and it seems fine.

Online yui

  • Posts: 159
  • Location: 127.0.0.1 (in azerty)
Re: Help with a teensy macropad
« Reply #3 on: Tue, 21 January 2020, 06:48:47 »
sorry if you checked already but are you sure your diode are the right way around? (or even marked the right way around, cheap diodes can sometimes (rarely but i've heard of it happening) be marked backward)
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Re: Help with a teensy macropad
« Reply #4 on: Wed, 22 January 2020, 03:38:00 »
sorry if you checked already but are you sure your diode are the right way around? (or even marked the right way around, cheap diodes can sometimes (rarely but i've heard of it happening) be marked backward)
Yep, my diodes are fine.

Online yui

  • Posts: 159
  • Location: 127.0.0.1 (in azerty)
Re: Help with a teensy macropad
« Reply #5 on: Wed, 22 January 2020, 05:54:09 »
so either i read the schematics backward (input being 1 2 3 and output 8 9 10) or the software might be the problem, or you may have a fake teensy (happened not so long ago to an other member, his teensy was giving him garbage as output as well, https://geekhack.org/index.php?topic=102719.0 ) because i can't see a way that all 1 4 and 7 would activate at once, it would have been 1 2 3 i would have expected a short but there a short would not do that. i may need to think that over, not sure.
vi vi vi - the roman number of the beast (Plan9 fortune)

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Re: Help with a teensy macropad
« Reply #6 on: Tue, 28 January 2020, 02:38:29 »
Update on the macropad: I discovered I had the diodes the wrong way around, so I flipped them. Now I'm getting the two other actions from the selected column. I changed the keybinds to numbers for clarity when troubleshooting. So when I press button 1 I get numbers 4 and 7, if I press button 2 i get 5 and 8 and so on. The teensy is programmed to output to the row pins and with a multimeter current flows in that direction just fine so it's not like the diodes are broken.

Offline SCWes

  • Posts: 8
Re: Help with a teensy macropad
« Reply #7 on: Tue, 28 January 2020, 08:11:32 »
Update on the macropad: I discovered I had the diodes the wrong way around, so I flipped them. Now I'm getting the two other actions from the selected column. I changed the keybinds to numbers for clarity when troubleshooting. So when I press button 1 I get numbers 4 and 7, if I press button 2 i get 5 and 8 and so on. The teensy is programmed to output to the row pins and with a multimeter current flows in that direction just fine so it's not like the diodes are broken.

I think you should start uploading some pictures so we can better help you. I haven't used a teensy, but I used a teensy ++ 2.0 and got really strange output in the beginning because I was using PD6 which is meant for LEDs.

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Re: Help with a teensy macropad
« Reply #8 on: Wed, 29 January 2020, 05:22:54 »
Here's a picture of my matrix and the teensy https://imgur.com/a/FzOBP90. I know the soldering on the matrix looks a bit rough but they're all functional. I put in the header pins because I didn't feel comfortable soldering the wires directly on the teensy.

Offline gipetto

  • Posts: 49
Re: Help with a teensy macropad
« Reply #9 on: Wed, 29 January 2020, 05:59:32 »
the circuit is perfect. the middle diode on the right in the second picture looks different. maybe it's the angle but i don't see a black band. if it was a zener or something else it could cause problems.
i agree with the other poster who recommended a wire per switch without diodes. it's an easy way to isolate problems.
« Last Edit: Wed, 29 January 2020, 06:01:29 by gipetto »

Offline Nabster

  • Thread Starter
  • Posts: 6
  • Location: Finland
Re: Help with a teensy macropad
« Reply #10 on: Wed, 29 January 2020, 06:15:19 »
the circuit is perfect. the middle diode on the right in the second picture looks different. maybe it's the angle but i don't see a black band. if it was a zener or something else it could cause problems.
The diode is the same as all the others, the band was just a bit oscured because the diode is a bit crooked.
I might try to rewire it because I'm all out of ideas myself. Thanks.

Offline SCWes

  • Posts: 8
Re: Help with a teensy macropad
« Reply #11 on: Thu, 30 January 2020, 01:17:24 »
Based on the picture, the signal flow is going out from the black, and into the red, right?