diff --git a/OLEDDisplay.cpp b/OLEDDisplay.cpp index 9caf84f..5c0e05f 100644 --- a/OLEDDisplay.cpp +++ b/OLEDDisplay.cpp @@ -563,7 +563,7 @@ void OLEDDisplay::normalDisplay(void) { sendCommand(NORMALDISPLAY); } -void OLEDDisplay::setContrast(char contrast, char precharge, char comdetect) { +void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comdetect) { sendCommand(SETPRECHARGE); //0xD9 sendCommand(precharge); //0xF1 default, to lower the contrast, put 1-1F sendCommand(SETCONTRAST); @@ -854,4 +854,4 @@ char* OLEDDisplay::utf8ascii(String str) { void OLEDDisplay::setFontTableLookupFunction(FontTableLookupFunction function) { this->fontTableLookupFunction = function; -} \ No newline at end of file +} diff --git a/OLEDDisplay.h b/OLEDDisplay.h index 9326323..5141d73 100644 --- a/OLEDDisplay.h +++ b/OLEDDisplay.h @@ -217,7 +217,7 @@ class OLEDDisplay : public Print { // Set display contrast // really low brightness & contrast: contrast = 10, precharge = 5, comdetect = 0 // normal brightness & contrast: contrast = 100 - void setContrast(char contrast, char precharge = 241, char comdetect = 64); + void setContrast(uint8_t contrast, uint8_t precharge = 241, uint8_t comdetect = 64); // Reset display rotation or mirroring void resetOrientation(); diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 1d371c5..4b17693 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -1,13 +1,27 @@ # Upgrade from 3.x to 4.0 -There is one change that breaks compatibility with older versions. You'll have to change data type for all your binary resources such as images and fonts from +There are changes that breaks compatibility with older versions. -```c -const char MySymbol[] PROGMEM = { -``` +1. You'll have to change data type for all your binary resources such as images and fonts from + + ```c + const char MySymbol[] PROGMEM = { + ``` + + to + + ```c + const uint8_t MySymbol[] PROGMEM = { + ``` -to - -```c -const uint8_t MySymbol[] PROGMEM = { -``` +1. Arguments of `setContrast` from `char` to `uint8_t` + + ```c++ + void OLEDDisplay::setContrast(char contrast, char precharge, char comdetect); + ``` + + to + + ```c++ + void OLEDDisplay::setContrast(uint8_t contrast, uint8_t precharge, uint8_t comdetect); + ```