New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for reverse display #822
Comments
As mentioned here
I am not happy with adding such a reverse command to the lib itself. It would mean to update all the displays and check all datasheet whether the reverse command is possible or not. And finally I would need to test all the displays, which would be a big effort. |
Fair point. I would love to have this command sequence as something of the shelf, even if it is specific for some displays only, so people don't have to go through the datasheet as I have. How would you feel about having display specific functions then, for example |
Maybe I should add an extra command to the display. |
TBH, I fell in love with u8g2, precisely because it has loads of things of the shelf, including the awesome HAL, for which I've sent patches for AVR previously. Having display specific functionality as of the shelf functions, IMHO, seems more user friendly that having a wiki page with random hex codes for each display... we already have the datasheets for that. I'm happy to send a pull request with SH1106 scroll and reverse functionality, with functions, using any of the 2 suggestions I gave above, or something else you come up with. If you're interested, of course. |
Meanwhile I think more about some expert examples, which send commands directly to the OLED. |
Perhaps at least have the defines for the hex values for each display command? |
I have added the sendF command. It looks like this: https://github.com/olikraus/u8g2/blob/master/sys/arduino/u8g2_page_buffer/HardwareInverse/HardwareInverse.ino#L296 The "c" stands for command. You could also write "ca", then the function takes two more args, one command and one arg. There is also a pure C variant of the same function. |
Added another example for hardware scroll: It also gives a better idea of the SendF command. |
It is what it is... Thanks for the example. |
Dear Olikraus, Thank you very much. Jan. |
It is not there, but you could copy the code from here: Line 66 in ff30983
I can also add this function once... |
|
added |
done |
I just found out that the SH1106 has support for setting normal / reverse display (page 30). The current setup actually set it to normal (0x0A6), but there seems to be no interface to set it to reverse. I fiddled with it, and sending 0x0A1 works to set it to reverse.
How about, just like u8g2_SetContrast() (U8X8_WITH_SET_CONTRAST), we add u8g2_SetReverse() (U8X8_WITH_SET_REVERSE) to allow just that?
I can cut a pull request with this implementation for SH1106 / SSD1306, for which I can test. Other displays can come later.
The text was updated successfully, but these errors were encountered: