A few years ago, I purchased a no-name 3.2in TFT Touchscreen Shield from China and never got around uning it in any Project. So I guess it was playing time again this week and I finally experimented a bit with the shield mounted on an original Arduino UNO. And I can say after trying all 4 included examples, that BMP image processing is so slow, it brings back memories from my first PC (386-16MHz, 1MB RAM, 128KB VRAM, 33MB HDD).
So, on I went and tried colour text and was immediately presented with the problem of finding other than the six basic colour in 16-bit hexadecimal notation. The Adafruit-GFX library documentation gave away how the bits are encoded, but a convenient list would have been nicer. So here ist my expanded colour-list for the GFX-library.
Just copy&pase in front of the „void“ declaration and after the „include“ declarations.
// Assign human-readable names to some common 16-bit color values: #define BLACK 0x0000 #define BLUE 0x001F #define DBLUE 0x000F #define RED 0xF800 #define LGREEN 0x0F0F #define GREEN 0x07E0 #define DGREEN 0x02E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define ORANGE 0xF3E0 #define WHITE 0xFFFF #define CARBON 0x18E3 #define DGREY 0x39E7 #define GREY 0x7BEF #define LGREY 0xE71C // Find Values here: https://www.rapidtables.com/convert/number/binary-to-hex.html
The idea is to have a mobile scanner with the local crews so they can access the JMRI generated switchlists for their job via mobile phone or fascia panel. This particular device is only a test-build to learn micro controller based model railroad interfacing.
Using ab UNO wasn’t the smartest choice, as this much content on the display completely depletes its tiny memory. I will probably move to a mega or a board featuring a higher end microcontroller like the ESP8566 or ESP32.