def get_lcd_controller(self, columns, lines): from Adafruit_CharLCD import Adafruit_CharLCD lcd = Adafruit_CharLCD( cols = columns, lines = lines, rs = self._pin_rs, en = self._pin_en, d4 = self._pin_d4, d5 = self._pin_d5, d6 = self._pin_d6, d7 = self._pin_d7, backlight = self._pin_backlight, invert_polarity = False, enable_pwm = self._enable_pwm, pwm = self._get_pwm(), ) # Create custom chars, since not all ROMS have the PLAY and # PAUSE chars or other ones the user might need for i, pattern in enumerate(self._custom_char_patterns): lcd.create_char(i, pattern) return lcd
def get_lcd_controller(self, columns, lines): from Adafruit_CharLCD import Adafruit_CharLCD lcd = Adafruit_CharLCD( cols=columns, lines=lines, rs=self._pin_rs, en=self._pin_en, d4=self._pin_d4, d5=self._pin_d5, d6=self._pin_d6, d7=self._pin_d7, backlight=self._pin_backlight, invert_polarity=False, enable_pwm=self._enable_pwm, pwm=self._get_pwm(), ) # Create custom chars, since not all ROMS have the PLAY and # PAUSE chars or other ones the user might need for i, pattern in enumerate(self._custom_char_patterns): lcd.create_char(i, pattern) return lcd
# Create an object of the class MFRC522 print('Creating RFID reader') MIFAREReader = MFRC522.MFRC522() print('RFID reader created') # some special char for the cld _arrow_right = [16, 24, 20, 18, 20, 24, 16, 0] _arrow_right_filled = [16, 24, 28, 30, 28, 24, 16, 0] lcd = Adafruit_CharLCD(lcdConfig['rs'], lcdConfig['en'], lcdConfig['d4'], lcdConfig['d5'], lcdConfig['d6'], lcdConfig['d7'], _lcd_cols, _lcd_rows) # up to 8 user defined chars are allowed on location 0..7 lcd.create_char(0, _arrow_right) lcd.create_char(1, _arrow_right_filled) ip = get_ip_address() # welcome = "Welcome to the\nTTLeagueTerminal\n\nIP: {}".format(ip) welcome = '{:^' + str(_lcd_cols) + 's}\n{:^' + str( _lcd_cols) + 's}\n{:^' + str(_lcd_cols) + 's}\nIP: {}' welcome = welcome.format(ATT_LEAGUE_TERMINAL, 'Welcome to the', 'terminal', ip) lcd.clear() lcd.message(welcome) print(welcome) sleep(3) startMessage = '{:^' + str(_lcd_cols) + 's}\n\n{:^' + str( _lcd_cols) + 's}\n{:^' + str(_lcd_cols) + 's}' lcd.clear()