Você está no 3DFinder
Buscamos em Thingiverse, MakerWorld e Printables ao mesmo tempo para te dar o melhor de cada uma.
Descrição
a Morse code to plaintext keyboard body designed for a raspberry pi pico microcontroller and a momentary button. the button needs to be hot glued in place for the best fit and soldering is required to complete the project. a copy of the python text to be loaded onto the pico along with circuit python and the adafruit hid library can be found below (i don't have a github so it may need refactoring)
import board import digitalio import time import usb_hid from adafruit_hid.keyboard import Keyboard from adafruit_hid.keycode import Keycode led = digitalio.DigitalInOut(board.LED) led.direction = digitalio.Direction.OUTPUT key_A=Keycode.A key_Shift = Keycode.SHIFT keyboard=Keyboard(usb_hid.devices) button = digitalio.DigitalInOut(board.GP28) button.switch_to_input(pull=digitalio.Pull.DOWN) letter = "" letters = {"01":"A", "1000":"B", "1010":"C", "100":"D", "0":"E", "0010":"F", "110":"G", "0000":"H", "00":"I", "0111":"J", "101":"K", "0100":"L", "11":"M", "10":"N", "111":"O", "0110":"P", "1101":"Q", "010":"R", "000":"S", "1":"T", "001":"U", "0001":"V", "011":"W", "1001":"X", "1011":"Y", "1100":"Z", "000000":"BACKSPACE", "01111":"1", "00111":"2", "00011":"3", "00001":"4", "00000":"5", "10000":"6", "11000":"7", "11100":"8", "11110":"9", "11111":"0"} timer_start = 0.01 sent = True sent2 = True while True: while button.value != True: if (0.7 < (time.monotonic() - timer_start) < 1.5) and (sent == False): print(letter) try: exec("keyboard.press(Keycode." + letters[letter] + ")") exec("keyboard.release(Keycode." + letters[letter] + ")") sent2 = False except: pass letter = "" sent = True if (1.5 < (time.monotonic() - timer_start)) and (sent2 == False): sent2 = True print("test") keyboard.press(Keycode.SPACEBAR) keyboard.release(Keycode.SPACEBAR) sent = False time_passed = time.monotonic() - timer_start timer_start = time.monotonic() print(time_passed) while button.value != False: pass time_passed = time.monotonic() - timer_start timer_start = time.monotonic() if time_passed < 0.2: letter = letter + "0" elif time_passed < 0.7 and time_passed > 0.2: letter = letter + "1" else: letter = "" exec("keyboard.press(Keycode." + letters["000000"] + ")") exec("keyboard.release(Keycode." + letters["000000"] + ")") sent = True print(time_passed)
Gostou deste modelo? Crie uma conta grátis para salvar seus favoritos e voltar a eles depois.
Criar conta