Vielen Dank schon mal für die Hilfe!
Bounce2 scheint hier wirklich sehr hilfreich zu sein.
Würde mein Code in dieser Form Probleme verursachen?
#include <Bounce2.h>
#include <Keyboard.h>
#define Anzahl 10
const int ButtonPins[Anzahl] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
const char Eingabe[Anzahl] = {'q', 'w', 'e', 'r', 't', 'z', 'u', 'i', 'o', 'p'};
Bounce * buttons = new Bounce[Anzahl];
void setup() {
for (int i = 0; i < Anzahl; i++) {
buttons[i].attach( ButtonPins[i] , INPUT_PULLUP );
buttons[i].interval(1);
}
Keyboard.begin();
}
void loop() {
for (int i = 0; i < Anzahl; i++) {
if ( buttons[i].update()) {
if ( buttons[i].fell() ) {
Keyboard.press(Eingabe[i]);
}
else if ( buttons[i].rose() ) {
Keyboard.release(Eingabe[i]);
}
}
}
}
Ich habe mir dazu die Beispiele angesehen und "bounce_multiple" modifiziert, allerdings verstehe ich noch nicht ganz die Auswirkung von "interval()". Könnte mir das nochmal jemand erklären?