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

6

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.