-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFT-LCD ST7789V of ESP32 TTGO. #918
Conversation
This patch allows you to use TFT-LCD ST7789V of ESP32 TTGO
I have one of those boards, can help out with testing if needed. |
i also have one of these boards (TTGO T-Display) and could test |
@musk95 Do you also have the corresponding configuration yaml with correct pins. |
this->buffer_[pos++] |= (color>>8) & 0xff; | ||
this->buffer_[pos] |= color & 0xff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, to work I have to remove de "|"
this->buffer_[pos++] = (color>>8) & 0xff;
this->buffer_[pos] = color & 0xff;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with this correction, everything displays correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also confirm that the above suggestions work as expected (new text replaces previous text, instead of add graphics on top of each-other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here...this minor change fixed the overlaid pixels for me, too. 😄
I just tested that PR on my hardware (a TTGO display) and it works great. Here's the configuration I found worked:
I hope it helps merging that amazing job ! |
will test if needed. thanks |
rhs = [HexInt(x) for x in data] | ||
prog_arr = cg.progmem_array(config[CONF_RAW_DATA_ID], rhs) | ||
cg.new_Pvariable(config[CONF_ID], prog_arr, width, height) | ||
if config[CONF_TYPE].startswith('RGB565'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line needs a null check. If no type is specified the code generation crashes.
I hope this gets accepted, st7789v displays are a very nice colourful display and t-displays are cheap with a battery interface. I'll test it later, i have two of them. |
To be able to draw lines and write text, the color needs to be specified in the lambda:
|
this one needs lint and docs, is @musk95 around? |
|
||
CONF_BACKLIGHT_PIN = 'bl_pin' | ||
|
||
ST7789V = st7789v_ns.class_('ST7789V', cg.PollingComponent, spi.SPIDevice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to add display.DisplayBuffer
in the list here
I just picked up a couple of these boards last week and started working on my own branch to add this support. Then I found this! 😆 I've cloned this fork and I've got it up and running. Thanks for getting this rolling @musk95! Please let me know if there is anything I can do to help push this along so we can get it merged into |
Since the original author seems to not respond, would it be wise to fork that branch in order to proceed with the PR ? I'm not sure about the code of conduct in that case and I want @musk95 to be credited for his awesome work but also to make that patch a reality. Any advice on that ? I'm ready to write the doc and all of needed. |
Sure help is appreciated I am still supporting ESPHome, Otto is away but I'm pretty sure he will be around at some time. I believe you can fork @musk95 branch make all the changes needed then create another PR, this way he will be still be credited as you will be adding commits on top of his work. |
Oh cool! Thanks @glmnet. I'm happy to fork the fork, make the changes suggested here and bring my changes in, as well. I had a bunch of other stuff I was cleaning up in my branch already, like getting rid of the macro nightmare that lives in st7789v.h among some other things. The C/C++ code here was pretty clearly 95% copy/pasted from https://github.com/Bodmer/TFT_eSPI which is great but I'm pretty sure the original author spent more time writing compiler macros than they did writing C/C++ code. 😆 |
...as long as nobody objects, that is. 😇 |
One related question regarding the bits @chsw pointed out... Where is this stuff currently documented? I haven't done much digging just yet, but a cursory search around the existing ESPHome docs reveals little about |
According to the documentation, there is no support for color displays. Figured out how to set the colors by trial and error and looking at the source files. The display has 18 bit color depth, but I used a 16 bit color palette found online to set create the color definitions stored as substitutions. |
I was afraid you were going to say that. 😆 Thank you for (so very promptly) sharing! 🍻 |
Alrighty...hopefully this will make all of you happy! 😄 Here is some fun YAML you can try:
You'll just need to supply |
Docs have landed: esphome/esphome-docs#594 |
continuing in #1050 |
This patch allows you to use TFT-LCD ST7789V of ESP32 TTGO
Description:
Related issue (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: