Hi there, i'm trying to figure out how to change the intensity of light on specific pixels on my OLED SSD1309 display. I have figured out how to change the contrast of the whole screen, but i'm wondering if there is a way to control it for specific pixels individually. the attached code is what i'm currently working with. It changes the intensity of light for the entire screen and alternates between the different intensities. Any help would be much appreciated!!
// #include <Adafruit_SSD1306.h>
#include <splash.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
//Declaration for SSD1306 display connected using I2C
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup(){
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
display.fillScreen(WHITE);
display.display();
}
void setContrast(Adafruit_SSD1306 *display, uint8_t contrast) {
display->ssd1306_command(SSD1306_SETCONTRAST);
display->ssd1306_command(contrast);
}
void loop() {
setContrast(&display, 0); //contrast is a number between 0 and 255. Use a lower number for lower contrast
delay (1000);
setContrast(&display, 60);
delay (1000);
setContrast(&display, 125);
delay (1000);
setContrast(&display, 185);
delay (1000);
setContrast(&display, 255);
delay (1000);
}