![]() Mylcd.lcd_display_string("Hello World!", 1) Enter the following: import I2C_LCD_driverfrom time import *.Let's write "Hello World!" to the display.Using the example, line 22 would be changed to: "ADDRESS = 0x21" On line 22, enter your I2C address that we found in the "Install Necessary Components" section.On line 19, you will want to change "I2CBUS = 0" to "I2CBUS = 1".Copy this code from GitHub user DenisFromHR ( link) and save it in a file named "I2C_LCD_driver.py".Take note of your number, you will need it later. In the example, the I2C address is "21".This will show show you a table of devices connected to your pi ( link).Wait for the install to complete then enter:.The LCD screen should light up but nothing will be displayed. Once you have double and triple checked your connections, solder the jumper cables to you Raspberry Pi.Pi Pins->LCD Pins GPIO 8 -> SDA GPIO 9 -> SCL 5.0 VDC (either output) ->VCC Ground (any output) -> GND Attach jumper cables using the following (Raspberry Pi Zero W pin out ):.Shutdown and unplug your Pi (wait for the activity LED to stop flashing before unplugging).Choose "Yes" then exit the configuration menu.Select "I2C Enable/Disable automatic loading" ( link).Find and select "Advanced Settings" from the menu ( link).Open the Raspberry Pi terminal ( link) and type the following commands: sudo raspi-config Give that article a read if you get lost: link Enable I2C Much of the info for this section was pulled from an article posted on, including extra code to make your text do fun things.
0 Comments
Leave a Reply. |