Hi,
I working on project that have a file chooser screen, and I want highlight a currently selected file. Like on second image. But I have no idea how to achieve this?
It is possible to read currently printed character as a raw pixels into some array, then just apply invert mask and write data back to LCD? I try achieve this a few days, but my skills is not so good.
Is there some code examples to achieve this?
Think about it. Your current display is using setTextColor(BLACK, WHITE)
and you want to display something with setTextColor(WHITE, BLACK)
Since you have not mentioned what library you are using, I am just suggesting what would be appropriate for an Adafruit_GFX style library.
Seriously, say which library(s) you are using or paste/attach your code.
Then you would get an accurate answer. Probably within minutes.
David.
I'm use Peter Fleury's LCD library (code changed for my needs and for ST7920). And all characters creates ST7920 IC, not a library!!.
I'm looking for something like a function createCustomChar(), but in reverse - read currently printed character on LCD into char buffer array?
Of course, it is possible create all inverted characters and keeps this data in flash memory - but it is a not good solution in all ways, right?
Yes, you can treat the 7920 like 16x4 character display. The pinout is the same as a regular HD44780 16x2 LCD. It even obeys the same command set.
However, the ST7920 can be used as a GLCD with exactly the same pinout. Or more conveniently with an SPI interface.
In my humble opinion the 16x4 character option may have a higher resolution font than the HD44780 but the net effect is horrible.
So I would guess that most ST7920 users would treat it as a Graphics Display. e.g. with u8g or u8g2 linraries.
You would be able to use any font that you like. Draw graphics wherever you want. The SPI interface uses less wires than the parallel options.
Why are you using Fleury in an Arduino? The regular Arduino LCD libraries would be more convenient. And from memory, the 16x4 uses half-width font characters. The design is intended for 8x4 full-width Chinese characters.
David.
david_prentice:
Why are you using Fleury in an Arduino?
Why not? I'm using his library as code example. And I need print characters on LCD as quickly as possible. To print one standard character I need write only one byte. For custom character - I need write more bytes, it is too long for my project.
can you post the code please?