Beispiel #1
0
        GPIO.output(LIGHT_PIN, GPIO.HIGH)

    elif not play_input:
        timer += 1
        if timer == 25:
            player.shuffle(shuffle)
            shuffle = not shuffle

    elif play_input_prev != play_input and play_input:
        print("Play Button Released")
        GPIO.output(LIGHT_PIN, GPIO.LOW)

        if timer < 25:
            state = player.get_state()
            if state == 'paused' or state == 'stopped':
                player.resume()
            else:
                player.pause()

        timer = 0

    play_input_prev = play_input

    #####################
    ## NEXT
    #####################
    next_input = GPIO.input(NEXT_PIN)

    if next_input_prev != next_input and not next_input:
        print("Next Button Pressed")
        GPIO.output(LIGHT_PIN, GPIO.HIGH)
Beispiel #2
0
        GPIO.output(LIGHT_PIN, GPIO.HIGH)
	
    elif not play_input:
        timer += 1
        if timer == 25:
            player.shuffle(shuffle)
            shuffle = not shuffle

    elif play_input_prev != play_input and play_input:
        print("Play Button Released")
        GPIO.output(LIGHT_PIN, GPIO.LOW)

        if timer < 25:
            state = player.get_state()
            if state == 'paused' or state == 'stopped':
                player.resume()
            else:
                player.pause()

        timer = 0

    play_input_prev = play_input

    #####################
    ## NEXT 
    #####################
    next_input = GPIO.input(NEXT_PIN)

    if next_input_prev != next_input and not next_input:
        print("Next Button Pressed")
        GPIO.output(LIGHT_PIN, GPIO.HIGH)