Example #1
0
        if button.value() == BUTTON_ON:

            #np[0] = GREEN
            #np.write()

            print("Button Pressed, Opening Door")
            granted(1)
        if programMode == True:
            programModeOn()
        else:
            normalModeOn()
        cardTag = str(rf.get())
    #Caso não esteja lendo nenhum cartão, não proseguirá

    if programMode == True:
        if stp.IsMaster(cardTag):
            print("Master Card Scanned")
            print("Exiting Program Mode and Opening Door")
            print("-----------------------------")
            granted(1)
            programMode = False
        else:
            if stp.findCard(cardTag)[0]:
                print("I know this CARD, removing...")
                stp.rmCard(cardTag)
                #add retorno visual
                np[0] = RED
                np.write()
                time.sleep_ms(3000)
                #fim do retorno visual
                print("-----------------------------")