You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB
Python

"""ILI9341 demo (images)."""
from time import sleep
from ili9341 import Display
from machine import Pin, SPI # type: ignore
def test():
"""Test code."""
# Baud rate of 40000000 seems about the max
spi = SPI(1, baudrate=40000000, sck=Pin(14), mosi=Pin(13))
display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
if display.width >= 240 and display.height >= 240:
display.draw_image('images/RaspberryPiWB128x128.raw', 0, 0, 128, 128)
sleep(2)
display.draw_image('images/MicroPython128x128.raw', 0, 129, 128, 128)
sleep(2)
display.draw_image('images/Tabby128x128.raw', 112, 0, 128, 128)
sleep(2)
display.draw_image('images/Tortie128x128.raw', 112, 129, 128, 128)
else:
display.draw_image('images/RaspberryPiWB128x128.raw', 0, 0, 128, 128)
sleep(4)
display.draw_image('images/MicroPython128x128.raw', 0, 0, 128, 128)
sleep(4)
display.draw_image('images/Tabby128x128.raw', 0, 0, 128, 128)
sleep(4)
display.draw_image('images/Tortie128x128.raw', 0, 0, 128, 128)
sleep(9)
display.cleanup()
test()