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.

30 lines
694 B
Python

5 years ago
"""ILI9341 demo (images)."""
from time import sleep
from ili9341 import Display
from machine import Pin, SPI
def test():
"""Test code."""
# Baud rate of 40000000 seems about the max
spi = SPI(2, baudrate=40000000, sck=Pin(18), mosi=Pin(23))
display = Display(spi, dc=Pin(4), cs=Pin(16), rst=Pin(17))
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)
sleep(9)
display.cleanup()
test()