#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd1(0x26, 16, 2); //объявляем первый экран
LiquidCrystal_I2C lcd2(0x27, 16, 2); //объявляем второй экран
#define temp A0
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT);//привязываем вход термометра
//подсвечиваем оба дисплея
lcd1.init();
lcd1.backlight();
lcd2.init();
lcd2.backlight();
lcd1.setCursor(2, 0);
lcd1.print("Hello, world!");//на первом пишем послание
}
void loop() {
// put your main code here, to run repeatedly:
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
int analogValue = analogRead(A0);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
lcd2.setCursor(2, 0);
lcd2.print("temperature");
lcd2.setCursor(4, 1);
lcd2.print(celsius); //выводим данную тем-ру
lcd2.setCursor(10, 1);
lcd2.print("C");
}