I have a lot of button that need checking and do a Keyboard.write();
I want do write a function or a for-loop to do this for all the buttons.
my idea was:
CheckSwitch( 7, “state7”, “lastState7”, 65);
void CheckSwitch (int pin, String state, String lastState, int key)
state = digitalRead(pin);
if (state != lastState)
if (state == LOW)
lastState = state;
it copiles, but give no output.
is it even possible to change variables inside a function like this?
could you recommend another way to do this?