got OLED working

This commit is contained in:
dekunukem
2021-12-03 21:50:04 +00:00
parent 954ecb7613
commit 8bdf550177
7 changed files with 115 additions and 1 deletions

16
user_program/usb4vc_ui.py Normal file
View 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)