Skip to main content
enhanced language
Source Link

There is a function that invert the colors of your screen, andyou can pick either black on white or white on black, I have tried it and I have quite experience with your display, I think you should try this piece of code.

At the beginning of theyour Arduino code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easyAs you couldn't find on the thingsinternet, I am student and I learn alot from the internet, to for example search for such a function in an Arduino library, try searching it's documentation or it's page on GitHub then afterwards see the function you want through the pages, here is allbut don't just search the functions for your display...function directly it will sometimes won't work as they are not that popular.

As a last thing Here ! is the documents where I got the function with it's parameters from.

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

There is a function that invert the colors of your screen, and I have tried it, I think you should try this piece of code.

At the beginning of the code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easy the things for you, here is all the functions for your display....

Here !

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

There is a function that invert the colors of your screen, you can pick either black on white or white on black, I have tried it and I have quite experience with your display, I think you should try this piece of code.

At the beginning of your Arduino code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

As you couldn't find on the internet, I am student and I learn alot from the internet, to for example search for such a function in an Arduino library, try searching it's documentation or it's page on GitHub then afterwards see the function you want through the pages, but don't just search the function directly it will sometimes won't work as they are not that popular.

As a last thing Here is the documents where I got the function with it's parameters from.

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

removed some useless words
Source Link

There is a function that invert the colors of your screen, butand I have tried it on only monochrome OLEDs, as you haven't mentioned if your display is 2 color or RGB I think you should try this piece of code.

At the beginning of the code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easy the things for you, here is all the functions for your display....

Here !

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

There is a function that invert the colors of your screen, but I have tried it on only monochrome OLEDs, as you haven't mentioned if your display is 2 color or RGB I think you should try this piece of code.

At the beginning of the code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easy the things for you, here is all the functions for your display....

Here !

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

There is a function that invert the colors of your screen, and I have tried it, I think you should try this piece of code.

At the beginning of the code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easy the things for you, here is all the functions for your display....

Here !

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.

Source Link

There is a function that invert the colors of your screen, but I have tried it on only monochrome OLEDs, as you haven't mentioned if your display is 2 color or RGB I think you should try this piece of code.

At the beginning of the code be sure that you declared the object using the same name.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

To invert the display

display.invertDisplay(true);

To return the display again

display.invertDisplay(false);

As you said that you want a button to invert the display you might use this code I made

if(digitalRead(BUTTON_PIN)){
    display.invertDisplay(true);
}
else{
    display.invertDisplay(false);
}

Or you might use Interrupts for better performance depending on your code.

And to easy the things for you, here is all the functions for your display....

Here !

I hope I've helped you out. any edits in the answer is well appreciated, as I am a student.