Complete the code to import the library needed to control the LCD with I2C.
import [1]
The I2C_LCD_driver library is used to control the LCD with I2C on Raspberry Pi.
Complete the code to initialize the LCD display object.
lcd = I2C_LCD_driver.[1]()The lcd function initializes the LCD display object for use.
Fix the error in the code to display the text 'Hello' on the first line of the LCD.
lcd.[1]('Hello', 1)
The correct method to show text on the LCD is lcd_display_string, where the first argument is the text and the second is the line number.
Fill both blanks to clear the LCD and then display 'Bye' on the second line.
lcd.[1]() lcd.[2]('Bye', 2)
First, we clear the LCD with lcd_clear(). Then we use lcd_display_string to show 'Bye' on line 2.
Fill all three blanks to create a function that writes a message on line 1 and clears the display after 3 seconds.
import time def show_message(msg): lcd.[1]() lcd.[2](msg, 1) time.[3](3)
The function clears the LCD with lcd_clear(), displays the message on line 1 with lcd_display_string, then waits 3 seconds using time.sleep(3).
