Function for changing the brightness on a OLED screen from an Arduino 96 in (inches) display (SSD1306)

Tiempo de lectura: < 1 minuto

We bring you a function that allows to reduce the brightness of the OLED SSD1306 screen connected to our Arduino.

Palmeras noche - Pexels

We add this code using the Adafruit library:

We create this function:

We can add values in the range: 0-255

For level = 255, all pixels turn on → maximum brightness.

For level = 127, about half will be lit -> average brightness.

For level = 20, few points will light up -> very dim.

Leave a Comment