PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Displays

Name badge

EasyBudget $12Python · gpiozero

Turn a 16×2 I²C LCD (address 0x27, on SDA/SCL, powered from 5 V) into a name badge:

  • line 1: HELLO my name is (exactly 16 characters)
  • line 2: Grace, centred: 16 − 5 = 11 spare columns, 5 spaces on the left

Tip: Python's "Grace".center(16) does the centring for you. Pass cols=16, rows=2 to CharLCD.

More in Displays