Page 1 of 1

TFT LCD Screen module

Posted: Sat Jun 09, 2018 6:35 am
by OutoftheBOTS
OK I seemed to have everything working well for both a little 1.77" ST7735 screen and a 2.4" ILI9341 screen.

See the demo at https://www.youtube.com/watch?v=onzi71R ... e=youtu.be

I have written hopefully a user friendly driver and it can be found at https://github.com/OutOfTheBots/OpenMV_TFT

Feel free to fork and use as you like it is MIT license

I have some nice ideas for making some little PCBs for these screens with some nice features that hopefully OpenMV designers will like and want to use and especially I hope the users of OpenMV cam will like them. Stay tuned :)

Re: TFT LCD Screen module

Posted: Sat May 18, 2019 10:17 am
by Kabron
Hello,
I adjusted TFT_demo.py for ILI9341 in the following way:

Code: Select all

sensor.set_framesize(sensor.QVGA)
screen = TFT(spi, TFT.ili9341)
screen.set_window(0,0,320,240)
and got the wrong picture of double screens 160 wide and about 80 high
in upper part of the screen [ ][ ].
Correct picture occured only with 0,0,160,120 but only as part of the screen.

Re: TFT LCD Screen module

Posted: Mon Jun 10, 2019 9:46 am
by nickthegreek82
I can confirm that the library does not work with the latest firmware version. I had the same problem. I managed to make the screen to work correctly though using the fixed firmware : download/file.php?id=536

Re: TFT LCD Screen module

Posted: Thu Feb 13, 2020 4:26 pm
by Novice55
I have an Openmv H7 and I wanted to use it with a ili9341 240x320 2.8" display without the need of the IDE. The camera works fine when connected to the OpenMV IDE. Nice display good frame rate etc... But when I hook it to the 2.8" display all I get is a small strip of the video. I can see the display is active by waving my hand in front of the camera so I know it's getting the video feed. it's just restricted to a small edge of the display. I make the changes in the scripts of "Screen =TFT(spi, TFT.ili9341)" and "screen.set_window(0,0,320,240)" I have read and searched the forums and have tried several different firmware's suggested but to no avail. I've read in the forums where it has been a ongoing problem. Has the issue of the ili9341 interface been corrected for the H7? If so can someone send me in the right direction? Thanks.
OpenMV IDE Info:
Board H7, Sensor OV7725, Frimware: 3.6.0 Port COM3

Re: TFT LCD Screen module

Posted: Thu Feb 13, 2020 5:20 pm
by kwagyeman
I don't believe we support that display. Another user wrote a library for it however if you search the forums for that display.

Re: TFT LCD Screen module

Posted: Fri Mar 13, 2020 12:22 pm
by CRMANN
FYI: Using latest OpenMV IDE and an H7 w/ latest firmware...

I have successfully integrated the Adafruit 2.2" ILI9340C TFT module into my project, using the following TFT driver (referenced in this thread - thanks OutOfTheBots!):

--> https://github.com/OutOfTheBots/OpenMV_TFT

First, copy the file "OpenMV_TFT.py" to the USB flash storage of the H7. Then, run the (slightly modified) code below:

Code: Select all

#TFT screen demo to steam frame buffer to a external SPI screen

import sensor, image, time
from machine import SPI
from OpenMV_TFT import TFT

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)

clock = time.clock()

spi = SPI(2, baudrate=54000000) #create an SPI bus

#create an instance of the screen driver
#you mustr pass a SPI bus and type of screen (ili9341 or st7735
#optional can pass cs pin and dc pin default is cs='P3' and dc='P9'
screen = TFT(spi, TFT.ili9341)

#set window on screen to write to (x_start, Y_start, width, height)
#the window needs to be inside the resolution of the screen and must match the exact size of fb
screen.set_window(0,0,320,240)


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

    # some image processing code goes here...

    screen.write_to_screen(img) #send the fb to the screen
    print(clock.fps())
Key points: Note DC==9 per the comments. Also BACKLIGHT (LED) & RESET are connected to 3.3v.

Re: TFT LCD Screen module

Posted: Fri Mar 13, 2020 12:56 pm
by kwagyeman
Thanks for the library!