Is there such a thing as a fast library for the ILI9341 that can display true fonts?
There are a couple of fast versions for the adafruit library but the standard fonts are horrible above a certain size and the way adafruit implemented custom font rendering causes them to blink on refresh. I guess what I would be looking for was something like UTFT, but UTFT runs very slow regardless of the hardware (ARM, AVR, ESP, HW, SW, etc).
Is a monochrome graphic display the only way to get a display with a decent refresh on arduino?
I'm also pondering the Nextion, but cant find many arduino tutorials.
I migrated to 16 bit parallel interface displays and wrote my own libraries to get good performance. These incorporate numerals in different font sizes that are Run Length Encoded (RLE) which makes them much faster to render.
The libraries also incorporate the Adafruit Free Fonts with a better plotting algorithm, so those fonts are good for the text labels I use, and the RLE numerals are for the fast updating live sensor readings.
Even the Mega can paint a 72 pixel high numeral to the screen in a mere 2ms which is much faster than the TFT screen refresh rate so you get no blinking.
I'm not sure how, but the author managed to make it compatible with code for the UTFT library More Info here...
Marek's Due library will be faster on a Due. I wrote the library you reference (and the Instructable) for the UNO where memory is a problem. Note that fonts above number 4 only contain numerals and a few things like colons and a decimal point, other characters print as a "space".
The aim was to make it compatible with the Adafruit_GFX library. I had to modify the UTFT example significantly to work with the library (primarily to verify the performance improvement) so you will find it is not compatible with unmodified UTFT sketches.
One question, can you tell me why the analogue meter and clock work erratically in 1.06?
The meter works fine if compiled on 1.6.7, but the clock examples dont compile on the latter.
The library is finely optimised for the AVR (UNO, Mega and Leonardo) processors and relies on delays between SPI transactions, this boosts performance with AVR processors. The 1.06 IDE uses an older version of the GCC compiler and it optimises out some of these important software delays(!) by "inlining" more code so some of the SPI transactions fail (they happen to fast for the SPI pipeline) and sometimes pixels do not get correctly written to the display! I originally wrote the library for 1.06 and when I moved to 1.6.x it ran slower which was disappointing so that led to some tweaks to regain performance but then backwards compatibility was lost.
So use the later IDE versions.
I have a new version of the library ready for upload that runs faster again, I may have time to upload that to Github tomorrow. This new version may be backwards compatible with 1.06 as the critical delays are better controlled by enforcing inline code. I have added some new cool examples too
The TFT_Clock_Digital 2 doesn't initialize the screen properly under 1.06.
Under 1.6.7 It doesnt compile with error:
TFT_Clock_Digital2:78: error: 'conv2d' was not declared in this scope
uint8_t hh = conv2d(__TIME__), mm = conv2d(__TIME__ + 3), ss = conv2d(__TIME__ + 6); // Get H, M, S from compile time
^
C:\Users\Carlos\Documents\Arduino\libraries\TFT_ILI9341B\examples\TFT_Clock_Digital2\TFT_Clock_Digital2.ino: In function 'void loop()':
TFT_Clock_Digital2:102: error: 'ss' was not declared in this scope
ss++; // Advance second
^
TFT_Clock_Digital2:105: error: 'mm' was not declared in this scope
omm = mm; // Save last minute time for display update
^
TFT_Clock_Digital2:122: error: 'mm' was not declared in this scope
if (omm != mm) { // Redraw hours and minutes time every minute
^
exit status 1
'conv2d' was not declared in this scope
v1.0.6 is very OLD. I use v1.6.6 of the IDE. Yes, it does not parse the forward declaration properly. Edit like this:
TFT_ILI9341 tft = TFT_ILI9341(); // Invoke custom library
static uint8_t conv2d(const char* p); //.kbv add forward declaration.
uint32_t targetTime = 0; // for next 1 second timeout
uint8_t hh = conv2d(__TIME__), mm = conv2d(__TIME__ + 3), ss = conv2d(__TIME__ + 6); // Get H, M, S from compile time
This is needed for both the clock examples. You also need to enable the monster numerals in User_Setup.h
static uint8_t conv2d(const char* p); //.kbv add forward declaration.
uint32_t targetTime = 0; // for next 1 second timeout
uint8_t hh = conv2d(__TIME__), mm = conv2d(__TIME__ + 3), ss = conv2d(__TIME__ + 6); // Get H, M, S from compile time
Cool, that did the trick.
Regarding 1.06 I was referring to post #6, just to confirm whenever changes on the new version would make it compatible - Hopefully this will avoid others having issues and not knowing why.
The fonts load fine on the clocks its just a part of the screen is not initialized. Again, this works fine on 1.6.x
Latest version has been updated with corrected clock examples plus another more interesting arc drawing demo and a pie chart demo too.
I won't be trying to make the library backwards compatible with older pre 1.0.6 IDE versions, I see no benefit in doing this. I have tested using IDE 1.6.7 and the current latest 1.6.9
I am going to be very busy on some DIY projects for a while :), but post any problems here.