So I have done some more testing. I used a breadboard and some jumpers to move the Leonardo out of the dance pad enclosure to try to eliminate vibrations from jumping up and down on the pad as an issue. I continued to have this issue.
I then wrote some code (listed below) on my Arduino Uno to spam "LOW" signals to the Leonardo button pins at random to simulate lots and lots of inputs. As you can see, I have up to 3 signals at a time sent. I could not repeat the issue with this method. My setup with this test was to run pins 4-7 from the Uno as outputs, through a 1k resistor, in to pins 4-7 on the Leonardo. I used Pin 8 as the "On/Off" switch and jumped it to ground to switch on.
This leads me to thinking that there may be something wrong with my design of the buttons. When testing with the UNO i used the 1k resistors from the output pins to keep from damaging the LEONARDO inputs but there shouldn't be any need for me to add a resistor going to ground right? the LEONARDO should have a 20k resistor from 5V to the pin when it is designated as a pull up input. I tried running a 1k resister on the ground of the circuit anyway but that didn't resolve the issue.
It seems clear to me that there is something about these buttons that the Leonardo does not like. Is there any sort of error that would cause the board to light up the "L" LED when pin 13 isn't even activated in the code?
Arduino UNO code
int onOff = 1;
int randomNumber1 = 1;
int randomNumber2 = 1;
int randomNumber3 = 1;
void setup() {
// put your setup code here, to run once:
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, INPUT_PULLUP);
pinMode(13, OUTPUT); // Just to turn that stupid "L" light off!
digitalWrite(1ijkl3, LOW);// Just to turn that stupid "L" light off!
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
pinMode(0, INPUT);
randomSeed(analogRead(0));
}
void loop() {
// put your main code here, to run repeatedly:
onOff = digitalRead(8);
randomNumber1 = random(4, 8);
randomNumber2 = random(4, 8);
randomNumber3 = random(4, 8);
if(onOff == LOW)
{
digitalWrite(randomNumber1, LOW); //press
delay(10);
digitalWrite(randomNumber2, LOW); //press
delay(10);
digitalWrite(randomNumber3, LOW); //press
delay(10);
digitalWrite(randomNumber1, HIGH); //release
delay(10);
digitalWrite(randomNumber2, HIGH); //release
delay(10);
digitalWrite(randomNumber3, HIGH); //release
delay(10);
}
}