How do you invert text on the display?

General MicroView Support area - You have questions, find your answers here.

Moderators: phalanx, Help@GeekAmmo, marcus@geekammo

Post Reply
ryemac3
Posts: 14
Joined: Mon Nov 04, 2013 7:01 am
Location: USA

How do you invert text on the display?

Post by ryemac3 » Fri Mar 11, 2016 7:06 pm

I have a small clock interface that I'm working on. In order to set the clock, I have a button that steps the user through the various fields: hours, minutes, month, day, year, etc. Another push button increments the value. In order to let the user know what value they are setting, I wanted to invert the value being displayed. So far all I've been able to do is invert the entire display. I thought that passing oled.invert(hours); for example, would do the trick, but it just inverts the whole display.

How do you invert just a single portion of the display, or a single value on screen?

Or do I have to create an inverted font and swap out the characters?

skimask
Support Volunteer
Posts: 1244
Joined: Sun Nov 09, 2008 2:11 am
Location: Minot, N.D.

Re: How do you invert text on the display?

Post by skimask » Fri Mar 11, 2016 7:21 pm

....what display?
I ignore "one post wonders".

scotta
Posts: 45
Joined: Thu Jul 24, 2014 1:31 pm
Location: Toronto, Canada

Re: How do you invert text on the display?

Post by scotta » Sat Mar 12, 2016 5:23 am

I haven't tried it, but I think using some combination of setColor() and setDrawMode(), before writing your text, should allow you to write inverted text, or any other object.

You may find that the area that you want to write to has to be cleared or inverted before writing the text. You could do that with a filled rectangle, or writing text spaces before the actual text you want to display.

scotta
Posts: 45
Joined: Thu Jul 24, 2014 1:31 pm
Location: Toronto, Canada

Re: How do you invert text on the display?

Post by scotta » Sat Mar 12, 2016 5:46 am

OK, I just tried it. Just using setColor(BLACK), before writing, should do what you want. Remember to use setColor(WHITE) to return to normal mode.

ryemac3
Posts: 14
Joined: Mon Nov 04, 2013 7:01 am
Location: USA

Re: How do you invert text on the display?

Post by ryemac3 » Sun Mar 13, 2016 9:05 am

Cool. Thanks. That works.

Image

You can see how I've inverted the month in one image and minutes in the other. Although the font does leave something to be desired, it's progress nonetheless. Thanks.

Post Reply