BLE seems to require some kind of characteristic callback that is not yeet implemented here. USB and BT tested and examples updated.
34 lines
872 B
Arduino
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);
|
|
}
|
|
}
|