Files
earlephilhower_arduino-pico/libraries/KeyboardBT/examples/BTKeyboardPassword/BTKeyboardPassword.ino
T
Earle F. Philhower, III 79e1af7bde Add Keyboard LED callback for USB and BT (not BLE) (#1265)
BLE seems to require some kind of characteristic callback that is not yeet
implemented here.  USB and BT tested and examples updated.
2023-03-04 14:18:40 -08:00

34 lines
872 B
Arduino

/* Released into the public domain */
/* Earle F. Philhower, III <earlephilhower@yahoo.com> */
#include <KeyboardBT.h>
void ledCB(bool numlock, bool capslock, bool scrolllock, bool compose, bool kana, void *cbData) {
(void) numlock;
(void) scrolllock;
(void) compose;
(void) kana;
(void) cbData;
digitalWrite(LED_BUILTIN, capslock ? HIGH : LOW);
}
void setup() {
Serial.begin(115200);
KeyboardBT.begin("PicoW Password");
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
KeyboardBT.onLED(ledCB);
KeyboardBT.begin();
delay(5000);
Serial.printf("Arduino USB Password Typer\n");
Serial.printf("Press BOOTSEL to enter your super-secure(not!) password\n\n");
}
void loop() {
if (BOOTSEL) {
Serial.println("Typing password for you...shhhh....");
KeyboardBT.print("ThisPasswordIsWeakLikeABaby");
while (BOOTSEL);
}
}