it inverts the whole Display,but I only want to invert some sentences or chars like on this picture
Deck A...
In the german section of this forum I got this hint :
" In the program you have a variable who store the value of every char (5 bytes). This function writes these 5 bytes in the RAM and then transfer it to the display
Try to create (copy) a function who invert this value. Use for this a XOR with 255."
Im sorry, but Im not that C-Pro and want to ask if anyone can explain me that with some democode or something...
The character drawing is done inside the library. You'll have to modify the library to add inverted text drawing. The new function will be very similar to the existing 'write' except for two lines:
// Output one column at a time...
for (unsigned char i = 0; i < 5; i++) {
this->send(PCD8544_DATA, ~glyph[i]); //// Invert each column...
}
// One column between characters...
this->send(PCD8544_DATA, 0xFF); //// ...and the space between characters.
You could add code to the PD8544 object to maintain an inverseText flag and test the flag inside write(). Then the print functions which call write() will display in inverse as long as that flag is set:
LCD.setInverseText();
LCD.println("This text will display in inverse.");
LCD.println("So will this.");
LCD.setNormalText();
LCD.println("but this line will be normal");
LCD.setInverseText();
LCD.println("This text will display in inverse.");
LCD.println("So will this.");
LCD.setNormalText();
LCD.println("but this line will be normal");
This is logic for me, Ive trying this since days but my C-knowledge isnt that like yours
I need some hints how I implement this into the driver...
like
for (unsigned char i = 0; i < 5; i++) {
this->send(PCD8544_DATA, ~glyph[i]);
LCD.setInverseText(true);
LCD.println("This text will display in inverse.");
LCD.println("So will this.");
LCD.setInverseText(false);
LCD.println("but this line will be normal");
Note: I have not actually tested this code. It is a fairly simple change so I don't anticipate any problems.