QiaoTuCodes / MicroPython-_ILI9488

MicroPython Library for the ILI9488 TFT controller for 4-6 wire SPI
12 stars 3 forks source link

Problem using the library with OpenMV #1

Open BOB63 opened 1 year ago

BOB63 commented 1 year ago

Hi , I'm trying to use you driver on OpenMV camera. This is the sketch used but also If I don't have errors on OpenMV IDE serial console the TFT don't show any image , drawing or text. Any suggestion? Tks Roberto

` from time import sleep

from MYili9488 import DisplayTFT, color565

from ili9488 import Display, color565 from machine import Pin, SPI

from xglcd_font import XglcdFont

import random import sensor, image, lcd import time from sys import implementation

cs = Pin("P3", Pin.OUT) rst = Pin("P7", Pin.OUT) dc = Pin("P9", Pin.OUT)

def test():

#"""Test code."""
# Baud rate of 60000000 seems about the max
#spi = SPI(2, baudrate=54000000) #, sck=Pin(14), mosi=Pin(13))
#display = Display(spi, dc=Pin(21), cs=Pin(15), rst=Pin(33))

spi = SPI(2, baudrate=54000000 , polarity=0, phase=0) tft = Display(spi, dc, cs,rst) print(implementation) #returned correctly Micropython

sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # Special 128x160 framesize for LCD Shield. clock = time.clock()

while(True): clock.tick() img = sensor.snapshot()

# some image processing code goes here...
tft.draw_line(1,1,200,200,color565(0, 0, 255))
tft.draw_text8x8(10,10,"Prova" ,color565(0, 255, 0),background=0)
tft.block(0,0,0,0,img) #send the fb to the screen
print(clock.fps())`