hey all,
i'm new here. i never have had programming exept siemens plc.
i'm trying to make a display that reads 4 temp analog sensors.
it prints 2 data lines (this worked fine)
but for 4 data i would like that sensor 1+2 is displaying and after butten up or down sensor 3+4 is displaying.
can somebody help me on the way?
#include <LiquidCrystal.h>
int ThermistorPin1 = 1;
int ThermistorPin2 = 2;
int ThermistorPin3 = 3;
int ThermistorPin4 = 4;
int Vo1;
int Vo2;
int Vo3;
int Vo4;
float R1 = 10000;
float logR2, R2, T;
float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
LiquidCrystal lcd(8,9, 4, 5, 6, 7);
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
}
//vanaf de loop de lus programmeren
//sensor1 uitlaatgastemp ketel
void loop() {
Vo1 = analogRead(ThermistorPin1);
R2 = R1 * (1023.0 / (float)Vo1 - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
lcd.setCursor(0,0);
lcd.print("Tgas=");
lcd.print(T);
lcd.print(" C");
//sensor 2 uitlaattemp gas schouw
Vo2 = analogRead(ThermistorPin2);
R2 = R1 * (1023.0 / (float)Vo2 - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
lcd.setCursor(0,1);
lcd.print("Tschw=");
lcd.print(T);
lcd.print(" C");
//sensor 3 boiler temp
Vo3 = analogRead(ThermistorPin3);
R2 = R1 * (1023.0 / (float)Vo3 - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
lcd.setCursor(0,0);
lcd.print("Twat=");
lcd.print(T);
lcd.print(" C");
// delay en clear altijd opt laatste van de loop anders flikkerend scherm
//sensor 4 omgevingstemperatuur
Vo4 = analogRead(ThermistorPin4);
R2 = R1 * (1023.0 / (float)Vo4 - 1.0);
logR2 = log(R2);
T = (1.0 / (c1 + c2logR2 + c3logR2logR2logR2));
T = T - 273.15;
lcd.setCursor(0,1);
lcd.print("Tomg=");
lcd.print(T);
lcd.print(" C");
delay(1000);// delay en clear altijd opt laatste van de loop anders flikkerend scherm
lcd.clear();
}