My Arduino Micro Won't Stop Typing

This is my first post in a forum ever. I have a great deal of respect for this community so I will try to not let you down. I’ve tried Google-ing this problem to no avail. I’ve read the steps for decorum on the forum. I’ve tried to work the problem out myself, but I haven’t even found anyone else who’s had this problem.

Several years ago, I got a Nintendo emulator with several games from my childhood. Playing with the keyboard was a pain. So I rigged up 8 momentary buttons to my Micro and programmed them as a keyboard using the keyboard library (up,down,left,right, select=[tab], start=[enter], b=, a=[z] (or something like that). For several years now it has been my trusty little NES controller for my computer.

As of tonight, it is no longer functioning properly. The game was going haywire. So I opened a ‘Notepad’ and started up the controller. I get lines and lines of Xs, Zs, tabs, and returns (not to mention any direction hits that I can’t even see).

This is actually the 2nd Arduino Micro of mine to do this in the past few days.

Steps I took to troubleshoot:

  • Unplugged and plugged back in. Problem continued.
  • Checked all the connections for shorts. Negative
  • Disconnected all buttons from the Arduino and just plugged it in. Problem continued.
  • I tried blowing in the cartridge, but I hear that’s just a myth now.
  • Ensured nothing had changed from earlier and all terminals were clean. Negative
  • Tried a different USB port, and cable. Problem continued.
  • Tried to reload empty code on IDE, but every time I plugged it in to load, it would type some letters and the code would not compile or load without error.

I also tried to bribe the little guy, but I didn’t actually think that would help.
I’m out of ideas.

Please post your full sketch. If possible you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it’s ok to add it as an attachment.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read. If you’re using the Arduino Web Editor then you will not have access to this useful tool. I recommend using the standard Arduino IDE instead.

When your code requires a library that’s not included with the Arduino IDE please always post a link(using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

There isn't any code. I wrote the program 3 or 4 years ago. I've been through 2 computers since then. The arduino was dedicated to that purpose and until a few days ago, it was working perfectly.

I could reconstruct it if you want; but the actual code itself is long gone.

Please describe how you have the buttons wired.

I have 8 total momentary buttons.
A common power junction goes to each button.
Each button then goes to a junction:

  • Digital Pin
  • Resistor
    Resistors go to ground.

The written code was using
Keyboard.begin()
if(digitalRead(button)==HIGH
Keyboard.write(keystroke)

Basic, but it worked for over 3 years.