def screen_on(retPage, backlightControl):
if os.environ["KPPIN"] != "1":
launch_bg=os.environ["MENUDIR"] + "launch-bg.sh"
process = subprocess.call(launch_bg, shell=True)
pygame.quit()
if backlightControl == "3.5r":
process = subprocess.call("echo '1' > /sys/class/backlight/soc\:backlight/brightness", shell=True)
elif backlightControl == "4dpi-24":
process = subprocess.call("echo '80' > /sys/class/backlight/24-hat-pwm/brightness", shell=True)
else:
backlight = GPIO.PWM(18, 1023)
backlight.start(100)
GPIO.cleanup()
if os.environ["KPPIN"] == "1":
page=os.environ["MENUDIR"] + "menu-pin.py"
args = [page, retPage]
else:
page=os.environ["MENUDIR"] + retPage
args = [page]
os.execvp("python", ["python"] + args)
# Turn screen off
评论列表
文章目录