Example #1
0
def show_earthquake():
    e = __get_recent_earthquake__()
    if e == None: return
    
    # if this earthquake is expired, older than two hours
    # not show
    if (time.time() - time.mktime(e['time'])) > RECENT_TIME: return
    
    lcd.display_words([chr(213) + chr(205) * 12 + chr(184),
                       chr(179) + " " * 12 + chr(179),
                       chr(179) + " EARTHQUAKE " + chr(179), 
                       chr(179) + "  in WORLD  " + chr(179),
                       chr(179) + " " * 12 + chr(179),
                       chr(212) + chr(205) * 12 + chr(190)])    
    time.sleep(4)
    
    lcd.alarm(3)
    lcd_ext.marquee_display_words([time.strftime("%m/%d %H:%M:%S", e['time']), e['place'], e['mag'], e['lat'], e['lon'], e['dep']], 1)
    lcd.alarm(3)
    time.sleep(2)
Example #2
0
def alarm_display_words(words, min_x = 0, max_x = 84, min_y = 0, max_y = 6):
    if words == None: return
    lcd.alarm(1)
    lcd.display_words(words, min_x, max_x, min_y, max_y)