As is in the topic name, it is always detecting the button being pushed down... ON ALL OF THE PINS ALL AT ONCE. I was using a breadboard and even tried switching breadboards to see if maybe it was an issue with that and the issue persists. I checked each individual pin with simplified versions of this code. I even disconnected all of the buttons and such from the Arduino, but it is still just doing this. There is simply a constant flow of power from the ground to all the pins on the Arduino, the ones in the code are simply the ones I was going to use for my project. Is something wrong with my Arduino Micro? I only got it a few days ago. There are no shortcuts for the electricity either. There is no physical wire connections from the ground to any pins and yet this happens.
Yeah, there is no setup right now, just the board. There is nothing hooked up to it at all except the usb connector. I have run individual pin tests for almost every pin available and it still just always connects from the ground to the pin without the physical connection, the air might as well be ionized from what I tell.
yep, it was a real nightmare at first. I had to use the reset button several times just so that i could select the correct com and upload without opening and closing a million different applications.
Have you tried setting pinMode(9, INPUT_PULLUP); ?
That is pin 9, not having defined a mode.
I would guess pin 9 i floating and the µC is to busy trying to run Mouse.press(); and Mouse.release(); every time the pin flickers around.
Or maybe the
else {
Mouse.release();
in every clause is just too computational in-effective.
And there has to be some timer to not let this happen to often.
I can confirm your observation on a Micro. The mouse keeps on pressing. The reason is a bug in your code. You set pins 2..8 as INPUT_PULLUP but your code in loop(() uses 3..9; pin 9 is floating.
For your mental health, built in a safety switch. It also prevents the pain of the resetting of the board.
You need to connect A0 (the safety pin) to GND for the mouse actions to work; if it's HIGH it will release the mouse button and exit loop().
You have been clicking the mouse button like a maniac. The computer remembers that and it will honour every press / click that it received. Even disconnecting the Micro will not help till all those presses have been honoured.
You can invoke the bootloader of the Micro by double-tapping the reset button. You got it right somewhere along the line and hence could upload again.