Skip to content

Instantly share code, notes, and snippets.

@bored-engineer
Created May 19, 2021 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bored-engineer/e5c9bc289963ab6cb9abf137113afa74 to your computer and use it in GitHub Desktop.
Save bored-engineer/e5c9bc289963ab6cb9abf137113afa74 to your computer and use it in GitHub Desktop.
WebAuthn toggle automation
#define totalPins 6
int pins[totalPins] = {13, 12, 9, 8, 7, 6};
void setup() {
// Ensure the PINs never output voltage HIGH (5v) or we may fry the keys
for (byte idx = 0; idx < totalPins; idx++) {
pinMode(pins[idx], OUTPUT);
digitalWrite(pins[idx], LOW);
pinMode(pins[idx], INPUT);
}
// Wait 5 seconds for the keys to boot so we don't confuse them
delay(5000);
}
void loop() {
// Toggle each key on/off iteratively, cannot trigger more than one key at a time
for (byte idx = 0; idx < totalPins; idx++) {
pinMode(pins[idx], OUTPUT);
delay(50);
pinMode(pins[idx], INPUT);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment