Example #1
0
# To use GPIO 14 and 15 (Serial RX/TX)
# Remove references to /dev/ttyAMA0 from /boot/cmdline.txt and /etc/inittab

UP = 0
DOWN = 1

CurrentStationFile = "/var/lib/radiod/current_station"
CurrentTrackFile = "/var/lib/radiod/current_track"
CurrentFile = CurrentStationFile
PlaylistsDirectory = "/var/lib/mpd/playlists/"

log = Log()
radio = Radio()
lcd = Lcd()
rss = Rss()


# Signal SIGTERM handler
def signalHandler(signal, frame):
    global lcd
    global log
    pid = os.getpid()
    log.message("Radio stopped, PID " + str(pid), log.INFO)
    lcd.line1("Radio stopped")
    lcd.line2("")
    lcd.line3("")
    lcd.line4("")
    radio.exit()

Example #2
0
import sys
import time
import string
import datetime
from time import strftime
from radio_class import Radio
from lcd_class import Lcd
import shutil
import urllib
from lcd_class import Lcd
from xml.dom import minidom
import getpass, poplib
import datetime
import time
from rss_class import Rss
rss = Rss()#rss-ul, of course

mesaj_array = [' ',' ',' ',' ',' ',' ',' ',' ',' ',' ']#arhiva de mailuri
msg =""#mesajul curent?
CITY_ID = '877873' #codul pentru Ploiesti
TEMP_TYPE = 'c' #adica in grade celsius
WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?w=' + CITY_ID +' &u=c'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'
MENU_SWITCH = 25 #definitia butoanelor
LEFT_SWITCH = 14
RIGHT_SWITCH = 15
UP_SWITCH = 18
DOWN_SWITCH = 17
METEO=0
RADIO=1
AUTO="AUTO"#starea centralei