diff --git a/GemmaM0_Password_Vault/main.py b/GemmaM0_Password_Vault/main.py new file mode 100644 index 00000000..99f599aa --- /dev/null +++ b/GemmaM0_Password_Vault/main.py @@ -0,0 +1,50 @@ +# Gemma M0 Password Vault +# press cap touch pads to enter strong passwords over USB + +from digitalio import DigitalInOut, Direction +import touchio +import board +import time +from adafruit_hid.keyboard import Keyboard +from adafruit_hid.keycode import Keycode +from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS + +led = DigitalInOut(board.D13) +led.direction = Direction.OUTPUT + +touch0 = touchio.TouchIn(board.A0) +touch1 = touchio.TouchIn(board.A1) +touch2 = touchio.TouchIn(board.A2) + +# the keyboard object +# sleep for a bit to avoid a race condition on some systems +time.sleep(1) +kbd = Keyboard() +layout = KeyboardLayoutUS(kbd) + +while True: + if touch0.value: + led.value = True + print("A0 touched!") + layout.write("?F3ErPs5.C.m.0.d.S.") # enter your own password here + time.sleep(1) + + if touch1.value: + led.value = True + print("A1 touched!") + layout.write("6@LKNs(WV[vq6N") # enter your own password here + time.sleep(1) + + if touch2.value: + led.value = True + print("A2 touched!") + layout.write("3Ff0rT@9j2y&") # enter your own password here + time.sleep(1) + + time.sleep(0.01) + + print("Waiting for cap touches") + # turn off the LED + led.value = False + + time.sleep(0.01)