Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #pre requ $sudo apt-get install xdotool
- # https://stackoverflow.com/questions/57776473/im-using-dakboard-kiosk-on-raspberry-pi-and-is-there-way-to-code-a-gpio-button
- import subprocess
- import RPi.GPIO as GPIO
- import time
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
- print("\n\nscript started\n")
- while (True):
- if GPIO.input(17) > 0:
- print("F5 ingedrukt")
- subprocess.call(["/usr/bin/xdotool", "key", "F5"])
- time.sleep(0.3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement