123456789101112131415161718192021222324252627 |
- from subprocess import Popen, PIPE
- from time import sleep, perf_counter
- from datetime import datetime
- import board
- import digitalio
- import adafruit_character_lcd.character_lcd as characterlcd
- lcd_columns = 16
- lcd_rows = 2
- lcd_rs = digitalio.DigitalInOut(board.D16)
- lcd_en = digitalio.DigitalInOut(board.D17)
- lcd_d4 = digitalio.DigitalInOut(board.D13)
- lcd_d5 = digitalio.DigitalInOut(board.D6)
- lcd_d6 = digitalio.DigitalInOut(board.D5)
- lcd_d7 = digitalio.DigitalInOut(board.D26)
- lcd = characterlcd.Character_LCD_Mono(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6,
- lcd_d7, lcd_columns, lcd_rows)
- lcd.clear()
- def write(row1, row2):
- lcd.message = row1.ljust(16)[:16] + "\n" + row2.ljust(16)[:16]
|