Direkt zum Seiteninhalt springen
Filmstill aus TROPICAL MALADY: Aus dem Dunkeln heraus blickt ein Tiger auf den Betrachter. In zwei Bildecken sind in weiß Zeichnungen von Blättern.

Pppd-140

def send_byte(byte, is_data): send_nibble((byte>>4) & 0x0F, is_data) send_nibble(byte & 0x0F, is_data) time.sleep(0.002) # command execution time

GPIO.setmode(GPIO.BCM) for pin in [RS, E, DB4, DB5, DB6, DB7]: GPIO.setup(pin, GPIO.OUT) pppd-140

def lcd_init(): time.sleep(0.05) send_nibble(0x03, 0); time.sleep(0.005) send_nibble(0x03, 0); time.sleep(0.001) send_nibble(0x03, 0) send_nibble(0x02, 0) # 4-bit mode send_byte(0x28, 0) # function set send_byte(0x0C, 0) # display on send_byte(0x06, 0) # entry mode send_byte(0x01, 0) # clear time.sleep(0.002) 4) & 0x0F

def send_nibble(bits, rs_val): GPIO.output(RS, rs_val) GPIO.output(DB4, (bits>>0) & 1) GPIO.output(DB5, (bits>>1) & 1) GPIO.output(DB6, (bits>>2) & 1) GPIO.output(DB7, (bits>>3) & 1) GPIO.output(E, 1); time.sleep(0.001); GPIO.output(E, 0) is_data) send_nibble(byte & 0x0F

Gefördert durch:

  • pppd-140
  • pppd-140