[SOLVED]Arduino Pro Micro Keyboard Keeps Firing

Hello!

First off all i want to start with saying, I am not a programmer :slight_smile:

So i am using a Arduino Uno and a Pro Micro too start my computer and login automatically.
but the Pro Micro keeps firing, I will paste the code im using for the Micro below, it usually keeps firing "pin 6 = Enter/Return".
(In advance) Thank you for the response! and have a nice day!

 #include "Keyboard.h"

void setup() {
 Serial.begin(9600);
 pinMode(4, INPUT);
 pinMode(6, INPUT);
Keyboard.begin();
}

void loop() {
 if (digitalRead(4) == 1) {
   Serial.println("4 = on");
 Keyboard.print("299792458");
 Keyboard.press(176);
 delay(100);
 Keyboard.release(176);
 delay(500);

}

if (digitalRead(6) == 1) {
 Serial.println("6 ON!");
 Keyboard.press(176);
 delay(100);
 Keyboard.release(176);
 delay(500);

 }
}

What is connected to the two input pins? How are those devices (switches, I presume) actually wired?

I suspect a floating pin issue.

Hello! Thank you for the reply!

I figured it out... I did the incredibly stupid misstake of not checking whether the actual pinmode was set to "Output" (on the Arduino Uno), so i somehow changed the pinmode to input without realizing it, dont know how I missed that!

Once again Thank you!