ILI9341 Touchscreen Error
Asked 2 days ago
Modified 2 days ago
Viewed 38 times
0
I’m using a Raspberry Pi Pico and an ili9341 touchscreen. To the codes below;
import machine
import ili9341
# Set up the SPI bus
spi = machine.SPI(0, baudrate=10000000, miso=machine.Pin(16), mosi=machine.Pin(19),
sck=machine.Pin(18))
# Set up the LCD display
lcd = ili9341.ILI9341(spi, 240, 320, cs=machine.Pin(17), dc=machine.Pin(20))
# Clear the screen
lcd.clear()
# Write "Hello World" to the screen
lcd.write("Hello World")
# Display the screen
lcd.display()
i am getting this error: Traceback (most recent call last): File “”, line 8, in AttributeError: ‘module’ object has no attribute ‘ILI9341’
I downloaded the .py file in the link. https://github.com/rdagger/micropython-ili9341/blob/master/ili9341.py
EditFollowClose 4Flag
asked 2 days ago

1122 bronze badges
- 2I’m voting to close this question because in effect it is a duplicate of raspberrypi.stackexchange.com/questions/143129/… – joan 2 days ago
- 1@joan I asked for the code and circuit diagram in the previous thread, but I couldn’t find the answer I wanted. Now I’m getting an error and I opened this thread to resolve it. – MEnsar55 2 days ago
- 1You should have supplied the information requested for the original question. You are wasting your time and our time. – joan 2 days ago
- 1@joan I just want to print “Hello World” to the screen. This much. – MEnsar55 2 days ago
- 1@joan I’m sorry for taking up your time. – MEnsar55 2 days ago
- this might help: peppe8o.com/… – tlfong01 2 days ago
- this might also help: pypi.org/project/setuptools – tlfong01 2 days ago
- 1Does this answer your question? Rpi3B/Rpi4B ILI9341 / XPT2046 SPI 2.8″ Touch TFT LCD Connection / Driver Problem – Rohit Gupta yesterday
1 Answer
Sorted by:
Reset to default Highest score (default) Date modified (newest first) Date created (oldest first)
1
I think the error is occurring due to an installation problem with ili9341. Make sure that you have downloaded and installed the ili9341 library properly.
EditFollowFlag
answered 2 days ago
1111 bronze badge
Categories: Uncategorized