Beispiel #1
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)

    elif not next_input:
        timer += 1
        if timer == 25:
            player.play_new_playlist()

    elif next_input_prev != next_input and next_input:
        print("Next Button Released")
        GPIO.output(LIGHT_PIN, GPIO.LOW)

        if timer < 25:
            player.next_song()

        timer = 0

    next_input_prev = next_input
    time.sleep(0.05)

    #print GPIO.input(NEXT_TRACK_PIN)
Beispiel #2
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)
   
    elif not next_input:
	timer += 1
        if timer == 25:
            player.play_new_playlist()

            
    elif next_input_prev != next_input and next_input:
        print("Next Button Released")
        GPIO.output(LIGHT_PIN, GPIO.LOW)

        if timer < 25:
            player.next_song()

        timer = 0

    next_input_prev = next_input
    time.sleep(0.05)

    #print GPIO.input(NEXT_TRACK_PIN)