#include <LiquidCrystal_I2C.h>
#define I2C_1_ADDR 0x28
#define I2C_2_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd1(I2C_1_ADDR, LCD_COLUMNS, LCD_LINES);
LiquidCrystal_I2C lcd2(I2C_2_ADDR, LCD_COLUMNS, LCD_LINES);
void setup() {
// put your setup code here, to run once:
lcd1.init();
lcd1.backlight();
lcd2.init();
lcd2.backlight();
//print lcd
lcd1.setCursor(2,0);
lcd1.print("Hello, World!");
lcd1.setCursor(05,1);
lcd1.print("HW 7.5");
lcd2.setCursor(0,0);
lcd2.print("Temperature NTC");
}
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(5,1);
lcd2.print(celsius);
}