lcd_clear () display_current_station () time. lcd_display ( "Raspberry Pi", 2, "Internet Radio", 2, "by", 2, "Solino de Baay", 2 ) time. RISING, callback = callback_shutdown, bouncetime = 300 ) #Main program block def main (): LCDLib. RISING, callback = callback_voldown, bouncetime = 300 ) GPIO. RISING, callback = callback_volup, bouncetime = 300 ) GPIO. RISING, callback = callback_prev, bouncetime = 300 ) GPIO. RISING, callback = callback_next, bouncetime = 300 ) GPIO. system ( "mpc play" ) display_current_station () def callback_volup ( channel ): change_volume ( 5 ) def callback_voldown ( channel ): change_volume ( - 5 ) def callback_shutdown ( channel ): LCDLib. system ( "mpc play" ) display_current_station () def callback_prev ( channel ): os. lcd_display ( station, 1, "", 2, "", 1, "", 1 ) def callback_next ( channel ): os. readlines (): station += i # Send some text LCDLib. popen ( "mpc current" ) station = "" for i in f. lcd_clear () display_current_station () def display_current_station (): f = os. getvolume () currentvol = int ( currentvol ) displayvolume = "Volume: " + str ( newVol ) LCDLib. lcd_init () newVol = currentvol + volume mixer. lcd_init () #define volume function def change_volume ( volume ): global currentvol if ( currentvol = 0 ): LCDLib. PUD_DOWN ) # Bring OS down #Initialize display LCDLib. PUD_DOWN ) # Previous Channel button GPIO. setwarnings ( False ) # Mute warnings GPIO. getvolume () currentvol = int ( currentvol ) # GPIO Setup # Define GPIO for Radio Controls NEXT = 8 PREV = 7 VOLUP = 6 VOLDOWN = 5 SHUTDOWN = 13 GPIO. de Backlight # Added functionality for Volume UP and DOWN, Shutdown # Added interrupts for reading buttons # Date : 26-03-2017 # The wiring for the LCD is as follows: # 1 : GND # 2 : 5V # 3 : Contrast (0-5V)* # 4 : RS (Register Select) # 5 : R/W (Read Write) - GROUND THIS PIN! We do not want the LCD to send anything to the Pi 5v # 6 : Enable or Strobe # 7 : Data Bit 0 - NOT USED # 8 : Data Bit 1 - NOT USED # 9 : Data Bit 2 - NOT USED # 10: Data Bit 3 - NOT USED # 11: Data Bit 4 # 12: Data Bit 5 # 13: Data Bit 6 # 14: Data Bit 7 # 15: LCD Backlight +5V # 16: LCD Backlight GND (Red, Optional) # 17: LCD Backlight GND (Green, Optional) # 18: LCD Backlight GND (Blue, Optional) # import import RPi.GPIO as GPIO import time import os import alsaaudio import LCDLib import sys # Create Audio Object mixer = alsaaudio. #!/usr/bin/python # Script for Raspberry Pi Internet Radio # Author: Kyle Prier # Site: # LCD author : Matt Hawkins # Site : # Rework: Solino C.