def setDisplay(String, Name, Einheit):
    
    lcd = pylcdlib.lcd(0x27,1)
    lcd.lcd_write(0x01);
    Einheit1 = str(Einheit)
    Beschriftung = str(Name)
    Druck = String
    Druck_str = str(Druck) + Einheit1
    lcd.lcd_puts(Name ,1) #display "Raspberry Pi" on line 1
    lcd.lcd_puts(Druck_str,2) #display "Take a byte!" on line 2
    lcd.lcd_backlight(1)
import RPi.GPIO as GPIO
import time
import pylcdlib
import os

lcd = pylcdlib.lcd(0x27,1)
lcd.lcd_write(0x01);


# Variable Counter definieren
Counter = 0

# SoC als Pinreferenz waehlen
GPIO.setmode(GPIO.BCM)  

# Pin 24 vom SoC als Input deklarieren und Pull-Down Widerstand aktivieren
GPIO.setup(24, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)  

# ISR
def Interrupt(channel):  
    # Zugriff auf globale Variablen
    global Counter

    # Counter um eins erhoehen und ausgeben
    Counter = Counter + 1
    print "Counter " + str(Counter) 
    time.sleep(1)
    lcd.lcd_puts("Tschuess",1) #display "Raspberry Pi" on line 1
    lcd.lcd_backlight(1)
    os.system("shutdown now -f")
    
Exemple #3
0
import pylcdlib
import time
import sys

#usage :
#sudo python <String> <row>
#example :
#sudo python hello-world 2

x = sys.argv[1]
y = sys.argv[2]
print type(y)
lcd = pylcdlib.lcd(0x27, 1)
time.sleep(.1)
lcd.lcd_write(0x01)
time.sleep(.1)
#lcd.lcd_puts("test\n",1)
lcd.lcd_puts(str(x), int(y))
lcd.lcd_backlight(1)
import pylcdlib

lcd = pylcdlib.lcd(0x21, 0)
lcd.lcd_puts("Raspberry Pi", 1)  #display "Raspberry Pi" on line 1
lcd.lcd_puts("  Take a byte!", 2)  #display "Take a byte!" on line 2
Exemple #5
0
import pylcdlib
lcd = pylcdlib.lcd(0x21,0)  
lcd.lcd_puts("Raspberry Pi",1)  #display "Raspberry Pi" on line 1  
lcd.lcd_puts("  Take a byte!",2)  #display "Take a byte!" on line 2 
Exemple #6
0
import pylcdlib
lcd = pylcdlib.lcd(0x20, 0)
lcd.lcd_puts("Raspberry Pi", 1)  #display "Raspberry Pi" on line 1
lcd.lcd_puts("  Take a byte!", 2)  #display "Take a byte!" on line 2
Exemple #7
0
import urllib2

# Detect if running on a Raspberry Pi or not
global piornot
if (os.uname()[4][:3]=="arm"):
	print "Running on a pie"
	piornot = True
else: 
	print "Running on a PC!"
	piornot = False

# LCD
if (piornot):
	print ("Init Lcd")
	import pylcdlib
	lcd = pylcdlib.lcd(0x20,1,1)
	lcd.lcd_puts("Welcome to",1)  
	lcd.lcd_puts("  Autospot!",2)

	# Physical buttons
	# http://pythonhosted.org/RPIO/
	import RPIO

#import time
prev_input = 0

global curplaylist
global playlist
global cleantrack, trackindex, tracks
global username, password, autoplay
global curtrack
Exemple #8
0
 def __init__(self):
     self._lcd = pylcdlib.lcd(0x21,0)
Exemple #9
0
import pylcdlib
lcd = pylcdlib.lcd(0x20,0)
lcd.lcd_puts("Raspberry Pi",1)  #display "Raspberry Pi" on line 1
lcd.lcd_puts("  Take a byte!",2)  #display "Take a byte!" on line 2

Exemple #10
0
def writeLcdLine(adress,text,line):
    lcd = pylcdlib.lcd(bus, adress,1)
    lcd.lcd_write(0x01);
    lcd.lcd_puts(text,line)
    lcd.lcd_backlight(1)
Exemple #11
0
import pylcdlib
lcd = pylcdlib.lcd(0x29,1,1)
#lcd.lcd_putc('H')
lcd.lcd_write(0x00)

#lcd.lcd_clear()
lcd.lcd_puts("Hi!Ittraining",1)  #display "Raspberry Pi" on line 1
lcd.lcd_puts("I'm joseph chen",2)  #display "Take a byte!" on line 2
lcd.lcd_back(1)