Closed randmor closed 5 years ago
Trying to zero in on the problem. Seems we need to write a "display_pixel(x,y, color)" function for the ILI9341 TFT display. Piecing the story together from what Tony writes here:
https://cdn-learn.adafruit.com/downloads/pdf/micropython-displays-drawing-text.pdf
we should be able to code the rest of it up as follows:
import machine spi = machine.SPI(1, baudrate=32000000)
import ili9341 display = ili9341.ILI9341(spi, cs=machine.Pin(0), dc=machine.Pin(15)) display.fill(0) # Clear screen by filling it with black pixels.
def display_pixel(x,y,color): # This is the function that has to be developed. #
#
import bitmapfont bf = bitmapfont.BitmapFont(240, 320, display_pixel) bf.init() bf.text('Hello, World!', 0, 0, ili9341.color565(255,0,255)) # Print 'Hello, World!' in magenta bf.deinit()
Well, seems using GitHub is another learning curve I'll need to conquer.
You need only convert the color. The following did work for me:
def ili_pixel(x,y,color):
display.pixel(x,y,ili9341.color565(color[0], color[1], color[2]))
import bitmapfont
bf = bitmapfont.BitmapFont(240, 320, ili_pixel)
bf.init()
bf.text('Test Test Test', 0, 0, (255, 0, 255))
Hello Guys, I have same problem as @randmor . I try @gampam2000 code and still have issue with display text on my lcd.
`import machine import ili9341 import gfx import bitmapfont import rgb import rgb_text
spi = machine.SPI(1, baudrate=32000000) display = ili9341.ILI9341(spi, cs=machine.Pin(4), dc=machine.Pin(5))
color = [255,255,0] display.fill(0)
def ili_pixel(x,y,color): display.pixel(x,y,ili9341.color565(color[0], color[1], color[2]))
color = [255,255,0]
bf = bitmapfont.BitmapFont(240, 320, ili_pixel) bf.init() bf.draw_char('Test Test Test', 0, 0, color)`
What can i do to repair tihs?
hiya, we'll be archiving this repo, we're not supporting micropython code.
we've integrated a bunch of this font stuff into our soft framebuf implementation for circuitpython https://github.com/adafruit/Adafruit_CircuitPython_framebuf
we will be adding ili9341 support to circuitpython's displayio
via https://github.com/adafruit/Adafruit_CircuitPython_BitmapFont
Hi Tony.
I seem to recall in one of your videos you referred us here for text graphic support for the FeatherWing ILI9341 TFT Board. While there are examples for LED matix displays, I don't see something for the 240x320 pixel FeatherWing TFT display. Are you planning to do a port? Or are you leaving this for to us to figure out?