コード例 #1
0
ファイル: showip.py プロジェクト: drerik/pi-nokiaDisplay
def main():
    lcd.init()
    lcd.set_contrast(190)
    lcd.backlight(1)
    lcd.text("adresses:")
    ip = subprocess.check_output("hostname -I", shell=True)
    lcd.locate(0,1)
    lcd.text(str(ip.strip()) )
コード例 #2
0
ファイル: smiley.py プロジェクト: GorLinker/pcd8544
def main():
    lcd.init()
    lcd.cls()
    lcd.data(smiley)
    lcd.locate(2,2)
    lcd.data(ch)
    lcd.locate(3,0)
    lcd.text("c.a.h.")
    lcd.backlight(1)
コード例 #3
0
ファイル: smiley.py プロジェクト: visued/pcd8544
def main():
    lcd.init()
    lcd.cls()
    lcd.data(smiley)
    lcd.locate(2, 2)
    lcd.data(ch)
    lcd.locate(3, 0)
    lcd.text("c.a.h.")
    lcd.backlight(1)
コード例 #4
0
def lcdstatusupdate(sensor_count, i):
    date = datetime.now()
    lcd.locate(3, 0)
    lcd.text(date.strftime('%d/%m/%y'))
    lcd.locate(3, 1)
    lcd.text(date.strftime('%H:%M:%S'))
    lcd.locate(3, 2)
    lcd.text("sensr: %s" % sensor_count)
    lcd.locate(3, 3)
    lcd.text("Next: %s" % i)
    lcd.locate(3, 4)
コード例 #5
0
def value2lcd(date,id,desc,value):
    lcd.cls()
    lcd.locate(0,0)
    lcd.text(date)
    lcd.locate(0,1)
    lcd.text(id)
    lcd.locate(0,2)
    lcd.text(desc)
    lcd.locate(0,3)
    lcd.text("Temp: %s" % (value))
    lcd.locate(0,4)
コード例 #6
0
def stats():
    lcd.cls()
    lcd.locate(0,0)
    lcd.text(cpu_usage())
    lcd.locate(0,1)
    lcd.text(mem_usage())
    lcd.locate(0,2)
    lcd.text(disk_usage('/'))
    lcd.locate(0,3)
    lcd.text(network('eth0'))
    lcd.locate(0,4)
コード例 #7
0
def value2lcd(date, id, desc, value):
    lcd.cls()
    lcd.locate(0, 0)
    lcd.text(date)
    lcd.locate(0, 1)
    lcd.text(id)
    lcd.locate(0, 2)
    lcd.text(desc)
    lcd.locate(0, 3)
    lcd.text("Temp: %s" % (value))
    lcd.locate(0, 4)
コード例 #8
0
def lcdstatusupdate(sensor_count,i):
    date = datetime.now()
    lcd.locate(3,0)
    lcd.text(date.strftime('%d/%m/%y'))
    lcd.locate(3,1)
    lcd.text(date.strftime('%H:%M:%S'))
    lcd.locate(3,2)
    lcd.text("sensr: %s" % sensor_count)
    lcd.locate(3,3)
    lcd.text("Next: %s" % i)
    lcd.locate(3,4)
コード例 #9
0
def lcd_blink(text):
    i = 10
    lcd.cls()
    lcd.locate(0, 0)
    lcd.text(text)
    lcd.locate(0, 1)
    while i < 0:
        lcd.text("after %s sec" % (i))
        if i % 2:
            lcd.backlight(1)
        else:
            lcd.backlight(0)
        i -= 1
        time.sleep(1)
コード例 #10
0
ファイル: plotter.py プロジェクト: visued/pcd8544
def main():
    lcd.init()
    lcd.backlight(1)
    sample = CpuTemperature()
    #sample = LoadAverage()
    buf = RingBuffer(84)

    while True:
        current = sample.data()
        buf.append(current)
        lcd.image(render(buf))
        lcd.locate(0, 0)
        lcd.text(sample.format(current))
        time.sleep(1)
コード例 #11
0
def lcd_blink(text):
    i=10
    lcd.cls()
    lcd.locate(0,0)
    lcd.text(text)
    lcd.locate(0,1)
    while i<0:
       lcd.text("after %s sec" % (i))
       if i%2:
           lcd.backlight(1)
       else:
           lcd.backlight(0)
       i-=1
       time.sleep(1)
コード例 #12
0
def main():
    lcd.init()
    lcd.backlight(1)
    sample = CpuTemperature()
    #sample = LoadAverage()
    buf = RingBuffer(84)

    while True:
        current = sample.data()
        buf.append(current)
        lcd.image(render(buf))
        lcd.locate(0,0)
        lcd.text(sample.format(current))
        time.sleep(1)
コード例 #13
0
ファイル: LCDd.py プロジェクト: engpedrorafael/pcd8544
def ifInfo():
    global hb

    lcd.locate(0, 5)
    st,out = getstatusoutput('ifconfig | grep "inet addr" | grep -v "127.0.0.1"')
    lineN=2
    if out:
        for line in [x for x in out.split(" ") if ":" in x and "cast" not in x and "addr" in x]:
            IP=(line.split(':')[1])
        lcd.text(IP+" "*(N_COLS-len(IP)))
    else:
        if hb:
            lcd.text(" "*N_COLS)
        else:
            lcd.text("  No network  ")
コード例 #14
0
ファイル: sqlite.py プロジェクト: visued/pcd8544
def lcd_press(press):
    
    MSL = "%07.2f" % float(msl(float(press)))
    press = "%07.2f" % float(press)
    if press[0] == "0": digit_0 = " "
    else: digit_0 = press[0]
    
    lcd.locate(1,3)
    lcd.text("QFE:"+digit_0+press[1:6])

    if MSL[0] == "0": digit_0 = " "
    else: digit_0 = MSL[0]

    lcd.locate(1,4)
    lcd.text("QNH:"+digit_0+MSL[1:6])
コード例 #15
0
ファイル: LCDd.py プロジェクト: engpedrorafael/pcd8544
 def write(self, line):
     ifInfo()
     self.lines.insert(0,line[0:N_COLS])
     if len(self.lines) == 6:
         self.lines.pop()
         for i,l in enumerate(self.lines):
             lcd.locate(0, i)
             lcd.text(self.lines[4-i]+" "*(N_COLS-len(self.lines[4-i])))
         self.hPos = min(len(self.lines[0]), N_COLS-1)
     else:
         lcd.locate(self.hPos, self.vPos)
         lcd.text(self.lines[0])
         self.vPos +=1
         if self.vPos == 5:
             self.vPos =4
             self.hPos = min(len(self.lines[0]), N_COLS-1)
コード例 #16
0
ファイル: airberryd.py プロジェクト: Korsani/airberry
def display(aToDisplay):
    aDisplay=[]
    lcd.cls()
    sToDisplay=''
    for sId in aToDisplay.keys():
        sToDisplay=sToDisplay+aToDisplay[sId]
    aDisplay=splitLineForLCD(sToDisplay,LCD_COLUMNS)
    y=0
    while len(aDisplay)>0:
        sLine=aDisplay.pop(0)
        lcd.text(sLine)
        y=y+1
        if y >= LCD_LINES:
            y=0
            time.sleep(5)
            lcd.cls()
        lcd.locate(0,y)
コード例 #17
0
ファイル: airberryd.py プロジェクト: LucaBongiorni/airberry
def display(aToDisplay):
    aDisplay = []
    lcd.cls()
    sToDisplay = ''
    for sId in aToDisplay.keys():
        sToDisplay = sToDisplay + aToDisplay[sId]
    aDisplay = splitLineForLCD(sToDisplay, LCD_COLUMNS)
    y = 0
    while len(aDisplay) > 0:
        sLine = aDisplay.pop(0)
        lcd.text(sLine)
        y = y + 1
        if y >= LCD_LINES:
            y = 0
            time.sleep(5)
            lcd.cls()
        lcd.locate(0, y)
コード例 #18
0
def demo(seconds):
    lcd.cls()
    lcd.text("Hello world!")
    lcd.locate(0, 4)
    lcd.text("Charlotte :-)")
    for loop in range(seconds * 4):
        lcd.locate(0, 1)
        lcd.text(time.strftime("%d %b %Y", time.localtime()))
        lcd.locate(0, 2)
        lcd.text(time.strftime("%H:%M:%S", time.localtime()))

        time.sleep(0.25)
コード例 #19
0
ファイル: clock.py プロジェクト: GorLinker/pcd8544
def demo(seconds):
    lcd.cls()
    lcd.text("Hello world!")
    lcd.locate(0, 4)
    lcd.text("Charlotte :-)")
    for loop in range(seconds * 4):
        lcd.locate(0, 1)
        lcd.text(time.strftime("%d %b %Y", time.localtime()))
        lcd.locate(0, 2)
        lcd.text(time.strftime("%H:%M:%S", time.localtime()))

        time.sleep(0.25)
コード例 #20
0
ファイル: pi_logo.py プロジェクト: GorLinker/pcd8544
def demo():
    lcd.locate(0,0)
    lcd.data(logo)
コード例 #21
0
ファイル: lcd.py プロジェクト: Korsani/airberry
#!/usr/bin/env python

import pcd8544.lcd as lcd
import sys

backlight={'ON':0,'OFF':1}

if __name__ == "__main__":
    lcd.init()
    lcd.set_contrast(180)
    if sys.argv[1] == 'text':
        lcd.locate(int(sys.argv[2]),int(sys.argv[3]))
        lcd.text(sys.argv[4])
    if sys.argv[1] == 'backlight':
        lcd.backlight(backlight[sys.argv[2].upper()])
    if sys.argv[1] == 'cls':
        lcd.cls()
コード例 #22
0
ファイル: LCDd.py プロジェクト: engpedrorafael/pcd8544
 def blinkCursor(self, hb):
     lcd.locate(self.hPos, self.vPos)
     if hb:
         lcd.text(CURSOR)
     else:
         lcd.text(" ")
コード例 #23
0
ファイル: showip.py プロジェクト: drerik/pi-nokiaDisplay
def stats():
    lcd.text("adresses:")
    lcd.locate(0,0)
コード例 #24
0
#!/usr/bin/env python

import pcd8544.lcd as lcd
import sys

backlight = {'ON': 0, 'OFF': 1}

if __name__ == "__main__":
    lcd.init()
    lcd.set_contrast(180)
    if sys.argv[1] == 'text':
        lcd.locate(int(sys.argv[2]), int(sys.argv[3]))
        lcd.text(sys.argv[4])
    if sys.argv[1] == 'backlight':
        lcd.backlight(backlight[sys.argv[2].upper()])
    if sys.argv[1] == 'cls':
        lcd.cls()
コード例 #25
0
def demo():
    lcd.locate(0,0)
    lcd.text(list(map(chr, list(range(0x20, 0x74)))))
コード例 #26
0
def display_song_meta(text, **kwargs):
    lcd.locate(0, 0)
    bitmap = get_bitmap(text, **kwargs)
    lcd.data(bitmap)
コード例 #27
0
def demo():
    lcd.locate(0, 0)
    lcd.data(logo)
コード例 #28
0
ファイル: alphabet_text.py プロジェクト: visued/pcd8544
def demo():
    lcd.locate(0, 0)
    lcd.text(map(chr, range(0x20, 0x74)))
コード例 #29
0
def display_banner():
    lcd.locate(0, 5)
    lcd.text('  @wolfg1969  ')
コード例 #30
0
ファイル: sqlite.py プロジェクト: visued/pcd8544
def lcd_temp(temp):

    lcd.locate(1,2)
    lcd.text(temp)
    lcd.text('.', special_FONT)
    lcd.text('C')
コード例 #31
0
ファイル: sqlite.py プロジェクト: visued/pcd8544
def lcd_time(ltime):
 
    lcd.locate(1,1)
    lcd.text(ltime[11:19])
コード例 #32
0
ファイル: sqlite.py プロジェクト: visued/pcd8544
def lcd_date(date):

    lcd.locate(1,0)
    # Date in database is ISO format yyyy-mm-dd
    # Date displayed is EUR format dd/mm/yyyy
    lcd.text(date[8:10]+"/"+date[5:7]+"/"+date[0:4])
コード例 #33
0
def display_volume_bar(volume='-24.375000'):
    lcd.locate(0, 4)
    lcd.data(get_volume_bar_data(volume))