1
0
forked from me/IronOS

Contrast -> Brightness

As it makes a little more sense in a 1 bit display
This commit is contained in:
Ben V. Brown
2021-09-12 19:14:45 +10:00
parent 87a96bcff7
commit 4b2f350b35
37 changed files with 76 additions and 69 deletions

View File

@@ -45,7 +45,7 @@ I2C_CLASS::I2C_REG OLED_Setup_Array[] = {
{0x80, 0x14, 0}, /*Charge Pump settings*/
{0x80, 0xDA, 0}, /*Set VCOM Pins hardware config*/
{0x80, 0x02, 0}, /*Combination 2*/
{0x80, 0x81, 0}, /*Contrast*/
{0x80, 0x81, 0}, /*Brightness*/
{0x80, 0x00, 0}, /*^0*/
{0x80, 0xD9, 0}, /*Set pre-charge period*/
{0x80, 0xF1, 0}, /*Pre charge period*/
@@ -362,7 +362,7 @@ void OLED::setRotation(bool leftHanded) {
screenBuffer[9] = inLeftHandedMode ? 0xC8 : 0xC0;
}
void OLED::setContrast(uint8_t contrast) {
void OLED::setBrightness(uint8_t contrast) {
OLED_Setup_Array[15].val = contrast;
I2C_CLASS::writeRegistersBulk(DEVICEADDR_OLED, &OLED_Setup_Array[14], 2);
}

View File

@@ -62,7 +62,7 @@ public:
static void setRotation(bool leftHanded); // Set the rotation for the screen
// Get the current rotation of the LCD
static bool getRotation() { return inLeftHandedMode; }
static void setContrast(uint8_t contrast);
static void setBrightness(uint8_t contrast);
static void setInverseDisplay(bool inverted);
static int16_t getCursorX() { return cursor_x; }
static void print(const char *string, FontStyle fontStyle); // Draw a string to the current location, with selected font