DELETED
It converts a "normal" RGB colour (8-bits each) into what is called 565 format.
fch -> RRRRRGGG
fcl -> GGGBBBBB
where the low order bits of each input component are lost.
I don't know about the "fc" but h and l are, of course, High and Low.
IIRC, 565 is the colour scheme used by TFTs which gives them 65536 colours instead of the more than 16 million colours available in full 8-bits each RGB.
Pete
I presume you've seen this comment in UTFT.h in front of the declarations of fcl, etc.
/*
The functions and variables below should not normally be used.
They have been left publicly available for use in add-on libraries
that might need access to the lower level functions of UTFT.
Please note that these functions and variables are not documented
and I do not provide support on how to use them.
*/
byte fch, fcl, bch, bcl;
In other words, "Abandon hope, all ye who enter here".
But now you've got those names decoded you might stand a chance of figuring out how the library works.
Good luck ![]()
Pete
"font" (or "foreground"), not "front".
![]()
It means Foreground color Low and High bytes. (fcl, fch) The library uses 16 bits for color, but it is structured around a 8 bit platform. so in order to get the color you want, you would need to break up the color into 2 bytes (fcl, fch) and send them to the display.
Edited based on GH's suggestion.
HazardsMind:
You can't even use it with a UNO anymore. It would be better to have everything there but only allow the drivers you need for the displays you have.Sketch uses 34,036 bytes (105%) of program storage space. Maximum is 32,256 bytes.
Global variables use 380 bytes (18%) of dynamic memory, leaving 1,668 bytes for local variables. Maximum is 2,048 bytes.
Strange!!
Because this is what I get.... (After editing the memorysaver.h file which does EXACTLY what you are saying it SHOULD do!! Page 1 of UTFT.pdf!!)
Sketch uses 19,782 bytes (61%) of program storage space. Maximum is 32,256 bytes.
Global variables use 380 bytes (18%) of dynamic memory, leaving 1,668 bytes for local variables. Maximum is 2,048 bytes.
I for one am extremely grateful to Henning for his wonderful UTFT suite of libraries, people should remember he owes you nothing, and yet continues to strive to supporting all mainstream display models which is no mean feat!
Regards,
Graham
PS, that is only with 2 display drivers enabled, SSD1289 and CPLD.
I have a new personal rule - when people hijack the thread I'll delete ALL my posts.
Just for the benefit of any future viewers of this thread, the immature original poster deleted this post :-
Any optic expert(s) on this forum ?
This undocumented function ( used in UTFT) does some kind of "magic numbers" color manipulation.
I sure would like to know what fch and fcl stands for, and why is this function useful.
Google would not tell me.
Thanksvoid UTFT::setColor(byte r, byte g, byte b)
{
fch=((r&248)|g>>5); //??
fcl=((g&28)<<3|b>>3); //??
}