Git Product home page Git Product logo

micropython-ili9341's Introduction

Micropython Driver for ILI9341 display

This has been tested on an M5Stack module using the standard esp32 micropython port. The default font is the Adafruit glcdfont and additional fonts can be generated by a very slightly modified version of Peter Hinch's font-to-py program which includes a function in font file to return the pixel width of a string of characters.

m5stack

Rotation parameters

m5stack

micropython-ili9341's People

Contributors

jeffmer avatar jpfrancoia avatar vitasam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

micropython-ili9341's Issues

Potential bug in lcd.py

Hi,

Great library, it works smoothly with my ESP32 and my TFT screen.

I noticed that the data variable is undefined on this line:

if data is None:
.

Maybe the function defintion should be:

def _readblock(self, x0, y0, x1, y1, data=None):

If that's the case and if this repo is not dead, I can make a PR.

Cheers! Thanks for your work

Screen mirrored

I tried to run the m5stack example on an m5stack core. Using rotation=0 shows the text from right to left. Also width and height are reversed. rotation= 6 shows the text in the upper left corner from left to right, as expected, but width and height are reversed (I set w=320 and h=240, but i need to set w=240 and h=320 to get it right)

Thank you

ili934xnew.py module has mixed settings

Hi Jeff, I've noticed some of the settings in the ili934xnew.py module are mixed up, here are my findings.

Test platform: M5Go

Width and height are mixed up and opposite of what's expected

The rotations are mapped oddly too:
r=0 mirrored 0 degrees
r=1 mirrored 90 degrees
r=2 mirrored 180 degrees
r=3 mirrored 270 degrees
r=4 normal 180 degrees
r=5 normal 270 degrees
r=6 normal 0 degrees
r=7 normal 90 degrees

Hope this is helpful information for you.

Pins to use for a TTGO T8 v1.7

I got your code working on a TTGO T8 v1.7
It took me a while to figure out which pins to use, so I am posting here the init sequence in case this saves time to other people

spi = SPI(2, baudrate=40000000, miso=Pin(19), mosi=Pin(23), sck=Pin(18))
display = ILI9341(pi, cs=Pin(5), dc=Pin(0), rst=Pin(4), w=320, h=240, r=3)

Thanks!

Blit bitbuffer

Hi,
i try to load a raw image (60x60 pixels, rgb565) using the following code:

from machine import Pin, SPI
from ili934xnew import *
import tt24 as font
from framebuf import *

spi = SPI(1, baudrate=45000000)
d = ILI9341(spi, Pin('X5'), Pin('X4'), Pin('X3'),w=320,h=240,r=2)

bg=color565(100,100,100)
fg=color565(0,0,0)
d.set_color(fg,bg)
d.erase()

with open('prism.raw', 'rb') as fp:
    b = FrameBuffer(bytearray(fp.read()),60,60,framebuf.RGB565)
    d.blit(b, 30,30,120,120)

and get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "ili934xnew.py", line 247, in blit
IndexError: bytearray index out of range

is it my fault or some issue in the blit source?

Why is font_to_py.py modified?

This program has had numerous improvements over the last three years thanks to input from a number of users.

I'm baffled as to why you include get_width() in the font file. In my work this function lives in the display driver. The use of a modified version has caused confusion in the forum. Might I suggest you reconsider this decision?

If there is a technical reason for including this method, I will consider updating my format to include it.

Touch screen support

Hello,

I'm new to the LCDs IoT, and struggling with few touch screens for a project.
I'm unable to understand if that is currently implemented, from what I read in the ili9341xnew.py

I have two questions:

  1. Is the current driver supporting touch screens?
  2. Is the current driver providing support for writing images to the Framebuffer? (I don't understand where that library comes from)

Thank you for your help and support with this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.