Hi, I am fairly new to coding and I am hoping I can get some help with this problem. I am trying to display the temperature in both C and F however after some calculations there seems to be many numbers after the demical showing up on the lcd that I would like to get rid of.
Here is a part of my code, let me know if you need more:
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 8, 9, 10, 11);
float TX0, TX1, TX2, TX3, TX4, TX5, TX6, TX7, TX8, TX9, TXavg, T0, rh, ed, Td, ew, Tw;
void setup() {
lcd.begin(16,2);
}
void loop() {
TXavg = ((TX0+TX1+TX2+TX3+TX4+TX5+TX6)/7);
ed = 6.112pow(2.71828,((17.502Td)/(240.97+Td)));
ew = 6.112pow(2.71828,((17.502Tw)/(240.97+Tw)));
rh = ((ew-0.6687451584*(1+0.00115Tw)(Td-Tw))/ed)*100;
lcd.setCursor(0,0);
lcd.scrollDisplayLeft();
lcd.print("Temp Avg (C): ");
lcd.print(TXavg = ((TX0+TX1+TX2+TX3+TX4+TX5+TX6)/7));
Serial.print("TXavg (C): ");
lcd.setCursor(0,1);
lcd.print("Temp Avg (F): ");
lcd.print((TXavg * 9)/5 + 32);
Serial.print("TXavg (F): ");
lcd.setCursor(16,0);
lcd.print(" Humidity (%): ");
lcd.print(rh = ((ew-0.6687451584*(1+0.00115Tw)(Td-Tw))/ed)*100);
Serial.print("Humidity: ");
delay(500);
}