mirror of
https://github.com/dekuNukem/USB4VC.git
synced 2025-10-31 11:26:46 -07:00
got OLED working
This commit is contained in:
16
user_program/usb4vc_ui.py
Normal file
16
user_program/usb4vc_ui.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import time
|
||||
import sys
|
||||
import RPi.GPIO as GPIO
|
||||
|
||||
BUTTON_GPIO = 16
|
||||
|
||||
def button_pressed_callback(channel):
|
||||
print(time.time(), "Button pressed!")
|
||||
|
||||
GPIO.setmode(GPIO.BCM)
|
||||
GPIO.setup(BUTTON_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
||||
# https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/
|
||||
GPIO.add_event_detect(BUTTON_GPIO, GPIO.FALLING, callback=button_pressed_callback, bouncetime=100)
|
||||
|
||||
while 1:
|
||||
time.sleep(1)
|
||||
Reference in New Issue
Block a user