1

I am trying to incorporate LCD display features with the codes that are already written for the sensor. "lcddriver.py" is in "lcd". "distance.py" contains codes for my distance sensor. file This is the code that I used for the sensor:https://github.com/jumejume1/pi-LCD-Ultrasonic/blob/master/distance-lcd.py

The Pi shows that I had an error in terms of objects and attributes.

I wrote:

display = lcddriver.lcd()

it showed:

AttributeError: 'module' object has no attribute 'lcd'

In order to display sensor data on LCD Display, how can I fix the problem? Thank you very much in advance.

  • It's a lcd class instantiation not an attribute call because you use '()' after lcd... I don't understand. Try to remove the lcddriver.pyc file if you have download the git project and restart your pyhthon code maybe ? – Ephemeral Jan 1 at 19:08
  • Also, your red arrow point to a file without any extensions. Try to rename lcddriver.py – Ephemeral Jan 1 at 19:10
  • Thank you very much! This photo was taken before I renamed it. I tried after deleting the lcddriver.pyc file but it didn't work. – Sharyn Cao Jan 1 at 19:12
  • @Ephemeral I think I missed a important step before importing "lcddriver" but I can't figure it out.... – Sharyn Cao Jan 1 at 19:14
  • 1
    That question was asked by me as well haha – Sharyn Cao Jan 1 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.