#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 an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display1(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);
Adafruit_SSD1306 display2(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire1, -1);
void setup(){
Serial.begin(115200);
Wire.setSDA(20); //Cambiando los pines de I2C 0 (Wire)
Wire.setSCL(21);
Wire1.setSDA(26); //Cambiando los pines de I2C 1 (Wire1)
Wire1.setSCL(27);
//inicializando los mopdulos I2C despues de configurar los pines
// nota: los modulos i2c tienen la misma direccion
if(!display1.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
if(!display2.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for(;;);
}
//delay(2000); // Pause for 2 seconds
// Clear the buffer
display1.clearDisplay();
display2.clearDisplay();
display1.setTextSize(2);
display1.setTextColor(SSD1306_WHITE);
display1.setCursor(2,20);
display1.print(F("DIEGO ESTA"));
display2.setTextSize(2);
display2.setTextColor(SSD1306_WHITE);
display2.setCursor(0,20);
display2.print(F("RE-STUPID!"));
display1.display();
display2.display();
}
void loop(){
}