Read pixel from ILI9341

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
EBourreau
Posts: 1
Joined: Thu May 20, 2021 12:35 pm

Read pixel from ILI9341

Post by EBourreau » Thu May 20, 2021 1:28 pm

Hello everyone,
I'm using NodeMCU ESP8266+MSP2807. That is to say : ILI9341 for the LCD+XPT2046 for the Touch.
I can draw on it so it's ok.
But, I'd like to get the color of a pixel through SPI interface. And it doesn't work.
I get 0 every time.

For example :

Code: Select all

from machine import Pin, SPI
spi=SPI(baudrate=32000000,miso=Pin(12),mosi=Pin(13), sck=Pin(14))
import ili9341
display=ili9341.ILI9341(spi,cs=Pin(15),dc=Pin(2),rst=Pin(4))
red=colorto565(255,0,0)
display.pixel(100,100,red)
print(display.pixel(100,100))
gives 0
Have I done a mistake ? Even a physical one when I have wired the LCD with NodeMCU ?
Moreover, with the last command, the blue LED on the NodeMCU switches on.
Thanks for your help.

Post Reply