Hallo ich habe eine Anfangs Übung zum RaspberryPI mit dem LCD Display gemacht.
Ich habe den Code kontrolliert sowie den Aufbau der Schaltung. Ich habe auch keine Fehlermeldung mehr.
Trotzdem zeigt das LCD Display nichts an . Es leuchtet jedoch (es hat Strom)
Bitte um Hilfe!
Python
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
LCD_RS = 17
LCD_E = 8
LCD_D4 = 25
LCD_D5 = 24
LCD_D6 = 23
LCD_D7 = 18
GPIO.setmode(GPIO.BCM)
GPIO.setup(LCD_E, GPIO.OUT)
GPIO.setup(LCD_RS, GPIO.OUT)
GPIO.setup(LCD_D4, GPIO.OUT)
GPIO.setup(LCD_D5, GPIO.OUT)
GPIO.setup(LCD_D6, GPIO.OUT)
GPIO.setup(LCD_D7, GPIO.OUT)
LCD_WIDTH = 16
LCD_LINE_1 = 0x80
LCD_LINE_2 = 0xC0
LCD_CHR = 1
LCD_CMD = 0
E_PULSE = 0.00005
E_DELAY = 0.00005
INIT = 0.01
def lcd_enable():
time.sleep(E_DELAY)
GPIO.output(LCD_E, 1)
time.sleep(E_PULSE)
GPIO.output(LCD_E, 0)
time.sleep(E_DELAY)
def lcd_byte(bits, mode):
GPIO.output(LCD_RS, mode)
GPIO.output(LCD_D4, bits&0x10==0x10)
GPIO.output(LCD_D5, bits&0x20==0x20)
GPIO.output(LCD_D6, bits&0x40==0x40)
GPIO.output(LCD_D7, bits&0x80==0x80)
lcd_enable()
GPIO.output(LCD_D4, bits&0x01==0x01)
GPIO.output(LCD_D5, bits&0x02==0x02)
GPIO.output(LCD_D6, bits&0x04==0x04)
GPIO.output(LCD_D7, bits&0x08==0x08)
lcd_enable()
def lcd_string(message):
message = message.ljust(LCD_WIDTH," ")
for i in range (LCD_WIDTH):
lcd_byte(ord(message[i]),LCD_CHR)
def lcd_anzeige(z1, z2):
lcd_byte(LCD_LINE_1, LCD_CMD)
lcd_string(z1)
lcd_byte(LCD_LINE_2, LCD_CMD)
lcd_string(z2)
LCD_INIT = [0x33, 0x33, 0x32, 0x28, 0x0C, 0x06, 0x01]
for i in LCD_INIT:
lcd_byte(i,LCD_CMD)
time.sleep(INIT)
lcd_anzeige("0123456789ABCDEF", "wwwfranzis.de")
GPIO.cleanup()
Display More