yes a circuit would help.
and correct I made a mistake, I am confused about these four if statements
if (output1 < 600 ) { // you can change this parameter to fine tune the sensitivity
if (!check){
Keyboard.print("d");
Serial.println(output1);
check = !check;
}
}
if (output1 > 300) {
if (check){
check = !check;
}
}

