#include "U8glib.h"
#include <Wire.h>
#define TCAADDR 0x70
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH110X.h>
//5 Screen Using a Multiplexor for control.
//With Startup Logo.
//Multiple Analog Sensors.
//ALARMS with Sound.
//SCREEN USED
Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire, -1);
//INPUTS PINS
const byte P_OIL_T = 0; //OIL TEMP 0
const byte P_WATER_IN_T = 1; //WATER TEMP 1
const byte P_WATER_OUT_T = 2; //WATER TEMP 2
const byte P_AIR_IN_T = 3; //AIR IN TEMP 3
const byte P_AIR_OUT_T = 4; //AIR OUT TEMP 4
const byte P_FUEL_P = 6; //FUEL PRESURE 6
const byte P_OIL_P = 7; //OIL PRESSURE 7
const byte P_TURBO_P = 8; //TURBO PRESSURE 8
const byte P_AFR = 9; //AIR/FUEL RATIO 9
//OUTPUT PIN
const byte P_buzzer = 2; //buzzer to arduino pin 2
//Temp Values
bool startup = 0;
byte SCREENtyp = 2;
int POSX;
float OIL_T;
float WATER_IN_T;
float WATER_OUT_T;
float AIR_IN_T;
float AIR_OUT_T;
float FUEL_P;
float OIL_P;
float TURBO_P;
float AFR;
//Multiplexor function
void tcaselect(uint8_t i) {
if (i > 7) return;
Wire.beginTransmission(TCAADDR);
Wire.write(1 << i);
Wire.endTransmission();
display.begin();
}
void setup() {
tone(P_buzzer, 3500); // Send 1KHz sound signal...
delay(20); // ...for 1 sec
noTone(P_buzzer); // Stop sound...
Wire.begin();
Serial.begin(115200);
//Outputs
pinMode(P_buzzer, OUTPUT); // Set buzzer
//START SCREENs
tcaselect(0);
display.display();
display.clearDisplay();
tcaselect(1);
display.display();
display.clearDisplay();
tcaselect(2);
display.display();
display.clearDisplay();
tcaselect(3);
display.display();
display.clearDisplay();
tcaselect(4);
display.display();
display.clearDisplay();
}
//Alarm function
void Tone() {
byte x = 0;
while (x < 5) {
tone(P_buzzer, 3500); // Send 1KHz sound signal...
delay(60); // ...for 1 sec
noTone(P_buzzer); // Stop sound...
delay(60); // ...for 1sec
x++;
}
}
//1 //CITROEN SPORT LOGO
// '1', 129x64px
const unsigned char epd_bitmap_1 [] PROGMEM = {
};
//2 //CITROEN LOGO
// '2', 128x64px
const unsigned char epd_bitmap_2 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0f, 0xe0, 0x79, 0xff, 0xfe, 0xff, 0xf0, 0x01, 0xfe, 0x03, 0xff, 0xe3, 0xe0, 0x3c, 0x00,
0x00, 0x3f, 0xf8, 0x7d, 0xff, 0xfe, 0xff, 0xf8, 0x07, 0xff, 0x03, 0xff, 0xf3, 0xf0, 0x3c, 0x00,
0x00, 0x7f, 0xfc, 0x7d, 0xff, 0xfe, 0xff, 0xfe, 0x0f, 0xff, 0xc3, 0xff, 0xf3, 0xf8, 0x3c, 0x00,
0x00, 0xff, 0xfe, 0x7d, 0xff, 0xfe, 0xff, 0xfe, 0x1f, 0xff, 0xe3, 0xff, 0xe3, 0xf8, 0x3c, 0x00,
0x01, 0xf8, 0x3e, 0x7c, 0x0f, 0x80, 0xf8, 0x1f, 0x1f, 0x03, 0xe3, 0xc0, 0x03, 0xfc, 0x3c, 0x00,
0x01, 0xf0, 0x1c, 0x7c, 0x07, 0x80, 0xf8, 0x1f, 0x3e, 0x01, 0xf3, 0xc0, 0x03, 0xfc, 0x3c, 0x00,
0x01, 0xe0, 0x00, 0x7c, 0x07, 0x80, 0xf8, 0x1f, 0x3c, 0x00, 0xf3, 0xc0, 0x03, 0xfe, 0x3c, 0x00,
0x03, 0xe0, 0x00, 0x7c, 0x07, 0x80, 0xf8, 0x1f, 0x3c, 0x00, 0xf3, 0xc0, 0x03, 0xff, 0x3c, 0x00,
0x03, 0xc0, 0x00, 0x7c, 0x07, 0x80, 0xff, 0xfe, 0x7c, 0x00, 0xf3, 0xff, 0xf3, 0xdf, 0x3c, 0x00,
0x03, 0xc0, 0x00, 0x7c, 0x07, 0x80, 0xff, 0xfe, 0x7c, 0x00, 0xf3, 0xff, 0xf3, 0xcf, 0xbc, 0x00,
0x03, 0xc0, 0x00, 0x7c, 0x07, 0x80, 0xff, 0xfc, 0x7c, 0x00, 0xf3, 0xff, 0xf3, 0xc7, 0xfc, 0x00,
0x03, 0xe0, 0x00, 0x7c, 0x07, 0x80, 0xff, 0xf8, 0x3c, 0x00, 0xf3, 0xe0, 0x03, 0xc7, 0xfc, 0x00,
0x01, 0xe0, 0x08, 0x7c, 0x07, 0x80, 0xf8, 0xf8, 0x3e, 0x01, 0xf3, 0xc0, 0x03, 0xc3, 0xfc, 0x00,
0x01, 0xf0, 0x1e, 0x7c, 0x07, 0x80, 0xf8, 0xf8, 0x1f, 0x03, 0xe3, 0xc0, 0x03, 0xc3, 0xfc, 0x00,
0x00, 0xfc, 0x7e, 0x7c, 0x07, 0x80, 0xf8, 0x7c, 0x1f, 0xff, 0xe3, 0xe0, 0x03, 0xc1, 0xfc, 0x00,
0x00, 0xff, 0xfe, 0x7c, 0x07, 0x80, 0xf8, 0x3e, 0x0f, 0xff, 0xc3, 0xff, 0xf3, 0xc0, 0xfc, 0x00,
0x00, 0x7f, 0xf8, 0x7c, 0x07, 0x80, 0xf8, 0x1e, 0x07, 0xff, 0x83, 0xff, 0xf3, 0xc0, 0xfc, 0x00,
0x00, 0x1f, 0xf0, 0x7c, 0x07, 0x80, 0xf8, 0x1f, 0x01, 0xfe, 0x03, 0xff, 0xf3, 0xc0, 0x7c, 0x00,
0x00, 0x07, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
//3 //ZX LOGO
// '3', 129x64px
const unsigned char epd_bitmap_3 [] PROGMEM = {
};
//4 //2.0L LOGO
// '4', 128x64px
const unsigned char epd_bitmap_4 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x07, 0xff, 0xff, 0x07, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 0x3f, 0xff, 0xff, 0xcf, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0f, 0xff, 0xff, 0xf0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1e, 0x00, 0x00, 0x78, 0x00, 0xf0, 0x00, 0x00, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x00, 0x00, 0x3c, 0x01, 0xc0, 0x00, 0x00, 0x3e, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x00, 0x00, 0x1c, 0x03, 0x80, 0x00, 0x00, 0x3c, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x0e, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x0e, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x3f, 0xf8, 0x0e, 0x07, 0x00, 0xff, 0xe0, 0x1c, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x7f, 0xfc, 0x0e, 0x06, 0x03, 0xff, 0xf8, 0x1c, 0x06, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xff, 0xff, 0xfc, 0x0e, 0x0e, 0x03, 0xff, 0xf8, 0x1c, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xff, 0xff, 0xf8, 0x0e, 0x0e, 0x03, 0xff, 0xf8, 0x1c, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfc, 0x00, 0x00, 0x0c, 0x0e, 0x03, 0xff, 0xf8, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x70, 0x00, 0x00, 0x1c, 0x0e, 0x07, 0xff, 0xf8, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0x00, 0x00, 0x38, 0x0e, 0x07, 0xff, 0xf0, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xc0, 0x00, 0x00, 0x78, 0x0c, 0x07, 0xff, 0xf0, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xc0, 0x00, 0x00, 0xf0, 0x0c, 0x07, 0xff, 0xf0, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x80, 0x7f, 0xff, 0xe0, 0x1c, 0x07, 0xff, 0xf0, 0x18, 0x1c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x80, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xf0, 0x38, 0x1f, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x03, 0x81, 0xff, 0xff, 0xff, 0xfc, 0x07, 0xff, 0xe0, 0x38, 0x1f, 0xff, 0xff, 0xe0, 0x00,
0x00, 0x03, 0x80, 0xff, 0xff, 0xff, 0xfc, 0x01, 0xff, 0x80, 0x30, 0x0f, 0xff, 0xff, 0xe0, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xe0, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x1e, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x18, 0x1f, 0x00, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x07, 0x00, 0x00, 0x00, 0x38, 0x1f, 0xc0, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0xc0, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00,
0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x67, 0xf2, 0x00, 0x60, 0x07, 0x00, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe7, 0xe7, 0xf2, 0x7f, 0x23, 0xe3, 0x3f, 0x9f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe7, 0xe7, 0xe2, 0x7f, 0x27, 0xe3, 0x3f, 0x9e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe7, 0xef, 0xe2, 0x40, 0x66, 0x07, 0x3f, 0x9e, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xe7, 0xcf, 0xe6, 0x78, 0xe7, 0xf2, 0x7f, 0x9c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe7, 0xc0, 0x06, 0x7c, 0xe7, 0x22, 0x00, 0x1c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xef, 0xe0, 0x0e, 0xfe, 0x64, 0x07, 0x00, 0x78, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
//5 //SILUETA ZX
// '5', 128x64px
const unsigned char epd_bitmap_5 [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x40, 0x0f, 0xff, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x10, 0x40, 0x00, 0x03, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x10, 0x60, 0x00, 0x01, 0xfe, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x10, 0x60, 0x00, 0x10, 0x70, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x10, 0x20, 0x00, 0x08, 0x3a, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x00, 0x10, 0x30, 0x00, 0x04, 0x0f, 0x80, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc8, 0x00, 0x00, 0x10, 0x30, 0x00, 0x03, 0x03, 0xe0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x90, 0x00, 0x00, 0x10, 0x30, 0x00, 0x01, 0x81, 0xf0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x60, 0x00, 0x00, 0x10, 0x18, 0x00, 0x00, 0x60, 0x7c, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x80, 0x00, 0x00, 0x10, 0x18, 0x00, 0x00, 0x20, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x10, 0x1c, 0x00, 0x00, 0x30, 0x0f, 0x80,
0x00, 0x00, 0x00, 0x00, 0x01, 0xe6, 0x00, 0x00, 0x00, 0x30, 0x07, 0x80, 0x07, 0xe0, 0x07, 0x80,
0x00, 0x00, 0x00, 0x00, 0x7f, 0x8c, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x0f, 0xfe, 0x08, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x00, 0x01, 0xff, 0x80, 0x0f, 0xff, 0xfe, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x00, 0x1f, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x0f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x1c, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x01, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x00, 0x00,
0x00, 0x60, 0x07, 0xc0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x0f, 0x80, 0x40,
0x00, 0x60, 0x0c, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, 0x80, 0xe0,
0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
void drawCentreString(const String &buf, int x, int y)
{
int16_t x1, y1;
uint16_t w, h;
display.getTextBounds(buf, x, y, &x1, &y1, &w, &h); //calc width of new string
display.setCursor(x - w / 2, y);
display.print(buf);
}
void draw(byte SCREENtyp, float IN, String TXT, String TXT_, float IN2, String TXT2, String TXT2_, String TEXTE) {
//SCREEN WITH BAR PREPARED FOR -1 to 2
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SH110X_WHITE);
display.cp437(true); // Use full 256 char 'Code Page 437' font
//display.setTextColor(SH110X_BLACK, SH110X_WHITE); // Draw 'inverse' text
float TITLE=2.5;
float text=1.5;
if (SCREENtyp == 2) {
display.setTextSize(TITLE);
// Calculate the X and Y coordinates to center the text
POSX = (128 / 2); //- (u8g.getStrWidth(TEXTE.c_str())))
drawCentreString(TEXTE, 64, 0);
display.setTextSize(text);
drawCentreString((TXT + " " + IN + TXT_), 64, 25);
drawCentreString((TXT2 + " " + IN2 + TXT2_), 64, 50);
}
//SCREEN WITH TWO SENSOR WITH SAME TITLE
if (SCREENtyp == 3) {
display.setTextSize(TITLE);
drawCentreString(TEXTE, 64, 0);
display.drawRect(2,25,124,18,SH110X_WHITE);//FRAME
display.drawLine(2, 22, 2, 46,SH110X_WHITE); //LINE LEFT
display.drawLine(125, 22, 125, 46,SH110X_WHITE); //LINE RIGHT
display.drawLine(2 + 35, 22, 2 + 35, 46,SH110X_WHITE); //LINE 0 BOOST
display.drawLine(2 + 35 + 44, 26, 2 + 35 + 44, 42,SH110X_WHITE); //LINE 1 BAR
if (IN>0.0){ //IF PRESSURE POSIIVE
if (IN>2.0){ //IF ITS AT MAXIMUM
display.fillRect(37, 27, 89, 14,SH110X_WHITE); //POSITIVE PRESSURE BAR INDICATOR AT MAXIMUM
}
else{ //IF PRESSURE POSITIVE BUT ON MARGINS
POSX=map(IN,0.0,2.0,0,89);
display.drawRect(37, 27, POSX, 14,SH110X_WHITE); //POSITIVE PRESSURE BAR INDICATOR AT READED VALUE
}
}
else { //IF VACUUM
POSX=map(IN,-1.0,0.0,35,0);
display.drawRect(37-POSX, 27,POSX, 14,SH110X_WHITE); //VACUM PRESSURE BAR INDICATOR AT READED VALUE
}
display.setTextSize(text);
drawCentreString((TXT + IN + TXT_), 64, 52);
}
if (SCREENtyp == 4) { //Dos sensores distinto ambito
display.setTextSize(TITLE);
drawCentreString((TXT), 64, 0);
drawCentreString((TXT2), 64, 43);
display.setTextSize(text);
POSX = (128 ) - 2; //- u8g.getStrWidth(String(IN + TXT_).c_str())
drawCentreString((IN + TXT_), 64, 30);
drawCentreString((IN2 + TXT2_), 64, 62);
}
}
void loop() {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//READ ANALOG VALUES////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//A0
OIL_T = float(map((analogRead(P_OIL_T) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A0 Temp Aceite ");
//Serial.print(((float)analogRead(P_OIL_T)));
//Serial.print(" ");
//Serial.println(((float)OIL_T));
//A1
WATER_IN_T = float(map((analogRead(P_WATER_IN_T) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A1 Temp Agua ");
//Serial.print(((float)analogRead(P_WATER_T)));
//Serial.print(" ");
//Serial.println(((float)WATER_T));
//A2
WATER_OUT_T = float(map((analogRead(P_WATER_OUT_T) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A1 Temp Agua ");
//Serial.print(((float)analogRead(P_WATER_T)));
//Serial.print(" ");
//Serial.println(((float)WATER_T));
//A3
AIR_IN_T = float(map((analogRead(P_AIR_IN_T) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A3 Aire Admision Entrada ");
//Serial.print(((float)analogRead(P_AIR_IN_T)));
//Serial.print(" ");
//Serial.println(((float)AIR_IN_T));
//A4
AIR_OUT_T = float(map((analogRead(P_AIR_OUT_T) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A4 Aire Admision Salida ");
//Serial.print(((float)analogRead(P_AIR_OUT_T)));
//Serial.print(" ");
//Serial.println(((float)AIR_OUT_T));
//A6
FUEL_P = float(map((analogRead(P_FUEL_P) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A6 Presion Gasolina ");
//Serial.print(((float)analogRead(P_FUEL_P)));
//Serial.print(" ");
// Serial.println(((float)FUEL_P));
//A7
OIL_P = float(map((analogRead(P_OIL_P) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A7 Presion Aceite ");
//Serial.print(((float)analogRead(P_OIL_P)));
//Serial.print(" ");
//Serial.println(((float)OIL_P));
//A8
TURBO_P = float(map((analogRead(P_TURBO_P) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A8 Presion Turbo ");
//Serial.print(((float)analogRead(P_TURBO_P)));
//Serial.print(" ");
//Serial.println(((float)TURBO_P));
//A9
AFR = float(map((analogRead(P_AFR) * 10), 980 * 10, 450 * 10, 0, 140 * 10) / 10.0); //(float)analogRead(sensorPin);
//Serial.print("A8 Presion Turbo ");
//Serial.print(((float)analogRead(P_TURBO_P)));
//Serial.print(" ");
//Serial.println(((float)TURBO_P));
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///INTRO////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Logos on first Loop.
if (startup == 0) {
Serial.print("STARTUP LOGO");
//SCREEN1////////////////////////////
tcaselect(0); //Pantalla 5
display.clearDisplay();
display.drawBitmap(0,0,epd_bitmap_5, 128, 64, 1);
display.display();
//SCREEN2////////////////////////////
tcaselect(1); //Pantalla 4
display.clearDisplay();
display.drawBitmap(0,0,epd_bitmap_4, 128, 64,1);
display.display();
//SCREEN3////////////////////////////
tcaselect(2); //Pantalla 3
display.clearDisplay();
//display.drawBitmap(0,0,epd_bitmap_3, 128, 64,1);
display.display();
//SCREEN4////////////////////////////
tcaselect(3); //Pantalla 4
display.clearDisplay();
display.drawBitmap(0,0,epd_bitmap_2, 128, 64,1);
display.display();
//SCREEN5////////////////////////////
tcaselect(5); //Pantalla 5
display.clearDisplay();
//display.drawBitmap(0,0,epd_bitmap_1, 128, 64,1);
display.display();
startup = 1; //Escribimos la marca a 1 para que no vuelva a entrar.
delay(5000);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
else { //Escritura normal de pantallas
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//NORMAL SCREEN WRITE///////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
tcaselect(0); //Pantalla 5
display.clearDisplay();
draw(4, FUEL_P, "Fuel", "Bar", AFR, "AFR", "", "");
display.display();
tcaselect(1); //Pantalla 4
display.clearDisplay();
draw(2, AIR_IN_T, "In", "c", AIR_OUT_T, "Out", "c", "Intercooler");
display.display();
tcaselect(2); //Pantalla 3
display.clearDisplay();
draw(2, WATER_IN_T, "In", "c", WATER_OUT_T, "Out", "c", "Water");
display.display();
tcaselect(3); //Pantalla 2
display.clearDisplay();
draw(2, OIL_P, "Press", "c", OIL_T, "Temp", "c", "Oil");
display.display();
tcaselect(4); //Pantalla 1
display.clearDisplay();
draw(3, TURBO_P, "", "Bar", 0, "", "", "Turbo");
display.display();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ALARMS////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (OIL_T > 110.0) { //HIGH OIL TEMP
// Tone();
Serial.println("HIGH OIL TEMPERATURE");
}
if (WATER_IN_T > 110.0) { //HIGH WATER TEMP
//Tone();
Serial.println("HIGH WATER TEMPERATURE");
}
if (TURBO_P > 0.5 and (OIL_T < 80.0 or WATER_IN_T < 80.0)) { //HIGH BOOST LOW WATER/OIL TEMP
// Tone();
Serial.println("HIGH BOOST WITH COLD OIL/WATER");
}
if (OIL_P < 2.0) { //and afr its over 5 (ENGINE ON)
//Tone();
Serial.println("LOW OIL PRESSURE");
}
}
}