Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OLEDDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -854,4 +854,4 @@ char* OLEDDisplay::utf8ascii(String str) {

void OLEDDisplay::setFontTableLookupFunction(FontTableLookupFunction function) {
this->fontTableLookupFunction = function;
}
}
2 changes: 1 addition & 1 deletion OLEDDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
32 changes: 23 additions & 9 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
@@ -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);
```