-
Notifications
You must be signed in to change notification settings - Fork 226
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
{Usage Question} TFT_Sprite & M5.lcd #166
Comments
You can use these color codes
If StickC can work normally, but after the remote transmission of the color appeared abnormal, that is to say that the data read from the MQTT into the corresponding color conversion process has a problem, you can focus on reading the data, each color data separate output, to see where the problem is in the end |
Re
color = 0x000001 to 0x0000ff I think I see the issue I've been sending six digital colours, not four The link you have provided shows four digit colours. Would you happen to have a reference for your to create 4 digital HEX colours? Thanks for your assistance, yet again. |
Those color codes are RGB565 |
Thank you so much for your assistance. I've read this and think I might be able to do the RGB24 to RGB565 in NodeRed before sending over MQTT, hopefully without any changes to my M5StickC code. http://www.barth-dev.de/about-rgb565-and-how-to-convert-into-it/ Based loosely on this formula
I'll try it later on the week and report the results. |
Maybe you can use this function |
Thanks for all your help and support. I've gone the very long way around to get an RGB565 value from a colour picker and double checked the results with various web converters I've found. I'm fairly confident that I'm creating the correct RGB565 values and passing them to the M5stickC-Plus. Some work very well, others are wildly wrong. For this exercise, I think I'll stick to using hard coded / fixed values in the TFT library or send RGB565 values from an option list, rather than a colour picker. I've learnt a lot in the exercise, so nothing has been wasted. For your reference and for anyone else that is looking for RGB565 convertion soloam/node-red-contrib-colorspace#8 https://discourse.nodered.org/t/rgb565-color-space-mainly-for-spi-tft-screens/80574 |
I have tried looking for more information and I can't find it, I apologise if the info or a detailed example is somewhere.
Regarding these commands for a M5StickC and M5StickC-Plus
or
Where
bgColour
andColour
are eitherint
orunit32_t
What I'm trying to achieve is the ability to set the Screen colour and Text colour via a MQTT message.
{"bgColour":0xFF0000,"Colour":0x00FF00}
for exampleSo far I can pass HEX values to a Key in the M5StickC, but when applied to the commands, the colours are very strange.
0x000001
to0x0000ff
work perfectly for all four commands, ever tone of Blue that I could ever want,But when I try to add RED or GREEN, the colours are very strange.
Is it that I can ONLY use the preset colour options?
Where can I find the list?
Are these correct?
https://github.com/Bodmer/TFT_eSPI/blob/master/TFT_eSPI.h
As a work around, I have limited myself to 8 colour options and set the colour based on the MQTT message
and so on
The core question is
What is the correct way to pass a HEX colour value to either the
tftSprite.fillRect(
orM5.Lcd.fillScreen(
commands?For reference, if I do the this with the MiniEncoder LED, it works PERFECTLY
using JSON messages like these
or anything.
(I use a colour picker in Node-RED for testing)
(Going forward, I want to try to add the 8-Encoder to this script)
Many thanks in advance.
Going forward, is it acceptable to post an example script when I have this working?
The text was updated successfully, but these errors were encountered: