the-raspberry-pi-guy / lcd

This repository contains all of the code for interfacing with a 16x2 Character I2C LCD Display. This accompanies my YouTube tutorial here: https://www.youtube.com/watch?v=fR5XhHYzUK0
186 stars 107 forks source link

How can I use this script outsite the lcd folder #77

Closed jokerper closed 4 months ago

jokerper commented 5 months ago

Describe the issue Hello I can only use this script insite the lcd folder. How can I install the drivers file globaly in my raspberry pi 4, so I can write to my lcd anyware in my file structure.

Demo

Executed command and associated error

# Import necessary libraries for communication and display use
import drivers

# Load the driver and set it to "display"
# If you use something from the driver library use the "display." prefix first
display = drivers.Lcd()

# Main body of code
# Remember that your sentences can only be 16 characters long!
display.lcd_display_string("    jokerper    ", 1)  # Write line of text to first line of display
display.lcd_display_string("  Demo Pi code  ", 2)  # Write line of text to second line of display
>>> import drivers
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'drivers'

Host and software info

Checklist

Additional context Add any other context about the problem here.

cgomesu commented 5 months ago

please watch the tutorial and then provide us with more information about what you're trying to do exactly. I'd appreciate if you followed the issue template as well. I fixed your original submission, so just edit it with what is missing.

cgomesu commented 4 months ago

stale