Parpadeo pantalla oled

Hola, soy principiante en esto de Arduino, tengo este código que me refleja en pantalla oled los datos que le pido, el caso es que quiero que no se note tanto el parpadeo y no se como hacerlo, algo estoy haciendo mal y no doy con que, si me podéis echar una mano os lo agradezco. os adjunto el codigo que lo he generado con arduinobloks.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_INA219.h>
#include <MedianFilterLib.h>
#include <OneWire.h>
#include <DallasTemperature.h>

double amperaje;
double volataje;
double umbral_amperaje;
double umbral_voltaje;
double temperatura;
double tiempo;
String s_estado_alto_voltaje;
String s_crepuscular;
String s_modo_lluvia;
boolean b_lluvia;
boolean b_nivel_luz;
Adafruit_SSD1306 oled_1(128,64, &Wire,-1);
bool oled_1_autoshow=true;
Adafruit_INA219 ina219_1(0x40);
MedianFilter<double> medianFilter_10(5);
OneWire oneWireBus_5(5);

DallasTemperature ds18b20_5(&oneWireBus_5);

static const uint8_t PROGMEM oled_data_0[] PROGMEM = {128,64,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x84,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x6,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x19,0x83,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x20,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x69,0x41,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x56,0x61,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xd6,0x60,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xd6,0x70,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xd6,0x70,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xd6,0x78,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xd6,0x7c,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xd0,0x7c,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xd0,0x7e,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf,0xd0,0x7e,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xd0,0x7f,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xd0,0x7f,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3f,0xd0,0x7f,0x83,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0xd0,0x7f,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xd0,0x7f,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x7f,0xd0,0x7f,0xe1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xd0,0x7f,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xd0,0x7f,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xd0,0x7f,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xd0,0x7f,0xf8,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xd0,0x7f,0xfc,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xd0,0x7f,0xfc,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7,0xff,0xd0,0x3f,0xfe,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xf,0xff,0x80,0x9f,0xfe,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xff,0x40,0x4f,0xff,0x7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xfe,0x0,0x2f,0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3f,0xfe,0x80,0x7,0xff,0x83,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0xfe,0x0,0x17,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x7f,0xfe,0x0,0x17,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x7f,0xfe,0x0,0x17,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xfe,0x80,0x7,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xfe,0x0,0x2f,0xff,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0x40,0xf,0xff,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0x80,0x9f,0xff,0xf8,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xc4,0x7f,0xff,0xfc,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
static const uint8_t PROGMEM oled_data_1[] PROGMEM = {128,64,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xe0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0xc0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0xbf,0xff,0xff,0xb8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x7f,0xff,0xff,0xdc,0x0,0x0,0x0,0x0,0x0,0x0,0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0,0x3b,0xff,0xff,0xff,0xf3,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1d,0xff,0xff,0xff,0xe7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xe,0xff,0xff,0xff,0xce,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0x7f,0xff,0xff,0x9c,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3,0x9f,0xff,0xff,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0xc0,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xff,0xff,0xff,0xe0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0xc0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
unsigned long task_time_ms=0;

double fnc_ds128b20_temp_5(int _index)
{
	ds18b20_5.requestTemperatures();
	return ds18b20_5.getTempCByIndex(_index);
}

void setup()
{
  	pinMode(11, INPUT);
	pinMode(10, INPUT);
	pinMode(2, OUTPUT);
	pinMode(4, OUTPUT);

	Serial.begin(9600);
	Serial.flush();
	while(Serial.available()>0)Serial.read();

ina219_1.begin();
	ds18b20_5.begin();

	oled_1.begin(SSD1306_SWITCHCAPVCC,0x3C);
  oled_1.display();

}


void loop()
{

  	amperaje = medianFilter_10.AddValue(((ina219_1.getCurrent_mA() + 0)));
  	volataje = medianFilter_10.AddValue(((ina219_1.getBusVoltage_V() + 0)));
  	umbral_amperaje = 210;
  	umbral_voltaje = 10;
  	b_lluvia = digitalRead(11);
  	b_nivel_luz = digitalRead(10);
  	temperatura = fnc_ds128b20_temp_5(0);
  	if ((amperaje == umbral_amperaje)) {
  		tiempo = millis();
  	}

  	if (((b_nivel_luz == true) || ((b_lluvia == false) || (volataje < umbral_voltaje)))) {
  		digitalWrite(2, LOW);
  		delay(100);
  		s_estado_alto_voltaje = String("Desconectado");
  	}
  	else {
  		digitalWrite(2, HIGH);
  		delay(100);
  		s_estado_alto_voltaje = String("conectado");
  	}

  	//Serial.println(temperatura);
  	//Serial.println(b_lluvia);
  	//Serial.println(b_nivel_luz);
    Serial.println(s_estado_alto_voltaje);
    Serial.println(s_crepuscular);
  	if ((temperatura > 27)) {
  		digitalWrite(4, HIGH);
  		oled_1.clearDisplay();
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.drawBitmap(0,0,&oled_data_0[2],oled_data_0[0], oled_data_0[1],WHITE);
  		if(oled_1_autoshow)oled_1.display();
  	}
  	else {
  		digitalWrite(4, LOW);
  	}

  	if ((tiempo > 1500)) {
  		digitalWrite(2, LOW);
  		delay(500);
  		oled_1.clearDisplay();
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.drawBitmap(0,0,&oled_data_1[2],oled_data_1[0], oled_data_1[1],WHITE);
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.display();
  		tiempo = 0;
  		while(true);
  	}

  	if ((b_nivel_luz == true)) {
  		s_crepuscular = String("Modo Noche");
  	}
  	else {
  		s_crepuscular = String("Modo dia");
  	}

  	if ((b_lluvia == false)) {
  		s_modo_lluvia = String("Lluvia");
  	}
  	else {
  		s_modo_lluvia = String("       ");
  	}

  	if((millis()-task_time_ms)>=5000){
  		task_time_ms=millis();
  		oled_1.clearDisplay();
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(0,0);
  		oled_1.print(volataje);
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(65,0);
  		oled_1.print(String("Volt"));
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(0,17);
  		oled_1.print(s_crepuscular);
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(0,33);
  		oled_1.print(s_modo_lluvia);
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(0,50);
  		oled_1.print(String("AT."));
  		if(oled_1_autoshow)oled_1.display();
  		oled_1.setTextSize(2);
  		oled_1.setTextColor(WHITE);
  		oled_1.setCursor(40,50);
  		oled_1.print(String(s_estado_alto_voltaje));
  		if(oled_1_autoshow)oled_1.display();
      oled_1.display();
      delay(500);
  	}

}

El parpadeo te lo hace porque borra la pantalla cada vez que imprime.

Saludos

Te he toqueteado algo el codigo, pruebalo, si va mejor comentamos.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_INA219.h>
#include <MedianFilterLib.h>
#include <OneWire.h>
#include <DallasTemperature.h>

double amperaje;
double volataje;
double umbral_amperaje;
double umbral_voltaje;
double temperatura;
double tiempo;
String s_estado_alto_voltaje;
String s_crepuscular;
String s_modo_lluvia;
boolean b_lluvia;
boolean b_nivel_luz;
Adafruit_SSD1306 oled_1(128, 64, &Wire, -1);
//bool oled_1_autoshow = true;
Adafruit_INA219 ina219_1(0x40);
MedianFilter<double> medianFilter_10(5);
OneWire oneWireBus_5(5);

DallasTemperature ds18b20_5(&oneWireBus_5);

static const uint8_t PROGMEM oled_data_0[] PROGMEM = {128, 64, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x84, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x19, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x20, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x69, 0x41, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x56, 0x61, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xd6, 0x60, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xd6, 0x70, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xd6, 0x70, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xd6, 0x78, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xd6, 0x7c, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xd0, 0x7c, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7, 0xd0, 0x7e, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf, 0xd0, 0x7e, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xd0, 0x7f, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xd0, 0x7f, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xd0, 0x7f, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xd0, 0x7f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xd0, 0x7f, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xd0, 0x7f, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xd0, 0x7f, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xd0, 0x7f, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xd0, 0x7f, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xd0, 0x7f, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff, 0xd0, 0x7f, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xd0, 0x7f, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7, 0xff, 0xd0, 0x3f, 0xfe, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf, 0xff, 0x80, 0x9f, 0xfe, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x1f, 0xff, 0x40, 0x4f, 0xff, 0x7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xfe, 0x0, 0x2f, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x3f, 0xfe, 0x80, 0x7, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x3f, 0xfe, 0x0, 0x17, 0xff, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x7f, 0xfe, 0x0, 0x17, 0xff, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x7f, 0xfe, 0x0, 0x17, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xfe, 0x80, 0x7, 0xff, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0xff, 0xfe, 0x0, 0x2f, 0xff, 0xf0, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc1, 0xff, 0xff, 0x40, 0xf, 0xff, 0xf8, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0x80, 0x9f, 0xff, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xc4, 0x7f, 0xff, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x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0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
unsigned long task_time_ms = 0;

double fnc_ds128b20_temp_5(int _index)
{
  ds18b20_5.requestTemperatures();
  return ds18b20_5.getTempCByIndex(_index);
}

void setup() {
  pinMode(11, INPUT);
  pinMode(10, INPUT);
  pinMode(2, OUTPUT);
  pinMode(4, OUTPUT);

  Serial.begin(9600);
  Serial.flush();
  while (Serial.available() > 0)Serial.read();

  ina219_1.begin();
  ds18b20_5.begin();

  oled_1.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  oled_1.clearDisplay();
  oled_1.display();
  oled_1.setTextSize(2);
  oled_1.setTextColor(WHITE);

}


void loop() {

  amperaje = medianFilter_10.AddValue(((ina219_1.getCurrent_mA() + 0)));
  volataje = medianFilter_10.AddValue(((ina219_1.getBusVoltage_V() + 0)));
  umbral_amperaje = 210;
  umbral_voltaje = 10;
  b_lluvia = digitalRead(11);
  b_nivel_luz = digitalRead(10);
  temperatura = fnc_ds128b20_temp_5(0);
  if ((amperaje == umbral_amperaje)) {
    tiempo = millis();
  }

  if (((b_nivel_luz == true) || ((b_lluvia == false) || (volataje < umbral_voltaje)))) {
    digitalWrite(2, LOW);
    delay(100);
    s_estado_alto_voltaje = String("Desconectado");
  }
  else {
    digitalWrite(2, HIGH);
    delay(100);
    s_estado_alto_voltaje = String("conectado");
  }

  //Serial.println(temperatura);
  //Serial.println(b_lluvia);
  //Serial.println(b_nivel_luz);
  Serial.println(s_estado_alto_voltaje);
  Serial.println(s_crepuscular);
  if ((temperatura > 27)) {
    digitalWrite(4, HIGH);
    oled_1.clearDisplay();
    //if (oled_1_autoshow)oled_1.display();
    oled_1.drawBitmap(0, 0, &oled_data_0[2], oled_data_0[0], oled_data_0[1], WHITE);
    //if (oled_1_autoshow)oled_1.display();
    oled_1.display();
  }
  else {
    digitalWrite(4, LOW);
  }

  if ((tiempo > 1500)) {
    digitalWrite(2, LOW);
    delay(500);
    oled_1.clearDisplay();
    //if (oled_1_autoshow)oled_1.display();
    oled_1.drawBitmap(0, 0, &oled_data_1[2], oled_data_1[0], oled_data_1[1], WHITE);
    //if (oled_1_autoshow)oled_1.display();
    oled_1.display();
    tiempo = 0;
    while (true);
  }

  if ((b_nivel_luz == true)) {
    s_crepuscular = String("Modo Noche");
  }
  else {
    s_crepuscular = String("Modo dia");
  }

  if ((b_lluvia == false)) {
    s_modo_lluvia = String("Lluvia");
  }
  else {
    s_modo_lluvia = String("       ");
  }

  //if ((millis() - task_time_ms) >= 5000) {
  //task_time_ms = millis();
  oled_1.clearDisplay();
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(0, 0);
  oled_1.print(volataje);
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(65, 0);
  oled_1.print(String("Volt"));
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(0, 17);
  oled_1.print(s_crepuscular);
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(0, 33);
  oled_1.print(s_modo_lluvia);
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(0, 50);
  oled_1.print(String("AT."));
  //if (oled_1_autoshow)oled_1.display();
  //oled_1.setTextSize(2);
  //oled_1.setTextColor(WHITE);
  oled_1.setCursor(40, 50);
  oled_1.print(String(s_estado_alto_voltaje));
  //if (oled_1_autoshow)oled_1.display();
  oled_1.display();
//  delay(500);
//}

}

Impresionante. ostras Maximo Esfuerzo, te lo agradezco muchisimo, me has ahorrado horas de provaturas, entiendo que básicamente le has quitado, información repetida?? es para entender un poco más, gracias.
Una cosilla que no entiendo sabes porque si descomento la linea de que me salga en serial la temperatura, la pantalla se vuelve majara??? empiezan a salir simbolos raros.
Otras vez más muchas gracias

Si y para que entiendas un poco mas , ten en cuenta que todas las ordenes que des a la oled no trabajan directamente sobre ella ,actúan sobre un buffer de memoria ram y prácticamente no consumen tiempo.
La única orden que consume mas tiempo es la "oled_1.display();", que lanza el buffer completo a la oled, no tiene sentido escribir algo en el buffer e imprimirlo inmediatamente, es preferible completar el buffer primero con todas las impresiones y luego lanzarlo una sola vez, Por ejemplo:

    oled_1.clearDisplay();
    //if (oled_1_autoshow)oled_1.display();
    oled_1.drawBitmap(0, 0, &oled_data_1[2], oled_data_1[0], oled_data_1[1], WHITE);
    //if (oled_1_autoshow)oled_1.display();
    oled_1.display();

Lanzabas innecesariamente dos veces el buffer a la oled. Además, ¿Por qué dependiendo de la variable "oled_1_autoshow". Esta siempre es true y es innecesario el "if", manías del arduinobloks supongo. ¡Todas fuera!
Otra simplificación:

oled_1.setTextSize(2);
oled_1.setTextColor(WHITE);

Que repites varias veces. Siempre estas usando el mismo tamaño y fondo de pantalla sin cambiarlo en todo el loop. Pues al setup y lo haces una sola vez.
No le veía sentido al retraso final de 1 seg, (0,5 por la millis y 0,5 por el delay), asi qe le quite el if final.

Ni idea, me suena a conflicto entre librerías, (no las tengo instaladas y no tengo esos sensores), las que manejan la pantalla no creo que sean, intenta aislar el problema comentado las otras librerías y sus ordenes correspondientes, si es de eso busca una librería alternativa.

gonpezzi, te agradezco muchísimo tus respuestas, a parte de solucionarlo, he aprendido mucho.
Xavi

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.