Advertisement
mike2545

F5 kiosk refresh

Jun 19th, 2023
807
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | Fixit | 0 0
  1. #!/bin/bash
  2. #pre requ $sudo apt-get install xdotool
  3.  
  4. # https://stackoverflow.com/questions/57776473/im-using-dakboard-kiosk-on-raspberry-pi-and-is-there-way-to-code-a-gpio-button
  5. import subprocess
  6.  
  7. import RPi.GPIO as GPIO
  8. import time
  9.  
  10. GPIO.setmode(GPIO.BCM)
  11. GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
  12.  
  13.  
  14. print("\n\nscript started\n")
  15.  
  16. while (True):
  17.     if GPIO.input(17) > 0:
  18.         print("F5 ingedrukt")
  19.         subprocess.call(["/usr/bin/xdotool", "key", "F5"])
  20.         time.sleep(0.3)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement