#include <Wire.h>
#include <LiquidCrystal_I2C.h>
char array1[] = "Boost.p Bar"; // CHANGE THIS AS PER YOUR NEED
char array2[] = "Oil.p Bar"; // CHANGE THIS AS PER YOUR NEED
char array3[] = "Oil.t C"; // CHANGE THIS AS PER YOUR NEED
char array4[] = "Exhaust.t C"; // CHANGE THIS AS PER YOUR NEED
LiquidCrystal_I2C lcd(0x27, 20, 4); // CHANGE THE 0X27 ADDRESS TO YOUR SCREEN ADDRESS IF NEEDED
int boostp_raw; // Ladedrucksensor Pin A1
int oilp_raw; // Öldrucksensor Pin A2
int oilt_raw; // Öltemperatursensor Pin A3
int exhaustt_raw; // Abgastemperatursensor Pin A6
float boostp;
int oilp;
int oilt;
int exhaustt;
void setup()
{
Serial.begin(9600);
pinMode(1, INPUT);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(6, INPUT);
}
void loop()
{
boostp_raw = analogRead(1);
oilp_raw = analogRead(2);
oilt_raw = analogRead(3);
exhaustt_raw = analogRead(6);
boostp = map(boostp_raw, 0, 1023, 0.00, 4.00);
lcd.init();
lcd.backlight();
lcd.print(array1); // BY DEFAULT CURSOR IS SET AT 0,0 ie, 0th ROW AND 0th COLUMN
lcd.setCursor(12,0);
lcd.print(boostp);
lcd.setCursor(0,1);
lcd.print(array2);
lcd.setCursor(0,2);
lcd.print(array3);
lcd.setCursor(0,3);
lcd.print(array4);
Serial.println(boostp_raw, boostp);
}