예제 #1
0
def step_closed_pressed(channel):
    global stepClosedLastPressed
    now = getPrecTime()
    if now - stepClosedLastPressed <= debounceTime:
        printLog("step_closed_pressed: within debounce time, disregarding!")
        return
    printLog ("Step closed")
    stepClosedLastPressed = now
    if aw.win.GPIO.input(aw.win.SW_STEP_OPEN) == 0:
        cancelOverride()
        return
    newpos = aw.getWindowPosition() - stepSize
    if newpos < 0:
        newpos = 0
    writeOverride(newpos)
예제 #2
0
def step_open_pressed(channel):
    global stepOpenLastPressed
    now = getPrecTime()
    if now - stepOpenLastPressed <= debounceTime:
        printLog("step_open_pressed: within debounce time, disregarding!")
        return
    printLog ("Step open")
    stepOpenLastPressed = now
    if aw.win.GPIO.input(aw.win.SW_STEP_CLOSED) == 0:
        cancelOverride()
        return
    newpos = aw.getWindowPosition() + stepSize
    if newpos > aw.full_open_steps:
        newpos = aw.full_open_steps
    writeOverride(newpos)