Create Input button - Raspberry Pi Forums
is there way create 'esc' button?
have switch between 3.3v , gpio17, make send signal equal escape button, can exit game...
i'm trying python-uinput far no luck, tips?
have switch between 3.3v , gpio17, make send signal equal escape button, can exit game...
i'm trying python-uinput far no luck, tips?
got slice of code switch faulty...
code: select all
import rpi.gpio gpio import uinput gpio.setmode(gpio.bcm) gpio.setup(17, gpio.in) def main(): events = ( uinput.key_esc, ) device = uinput.device(events) device.emit(uinput.key_esc, 1) # press. device.emit(uinput.key_esc, 0) # release. while 1: if gpio.input(17)==true: #don't think '==true' part necessary main()
raspberrypi
Comments
Post a Comment