#define LED A0 // The pin the LED is connected to
void setup() {
pinMode(LED, OUTPUT); // Declare the LED as an output
Serial.begin(115200);
}
void loop() {
digitalWrite(LED, HIGH); // Turn the LED on
delay(1000);
digitalWrite(LED, LOW); // Turn the LED off
delay(1000);
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
int analogValue = analogRead(A1);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Analog read: ");
Serial.println(analogValue);
Serial.print("Temperture(C): ");
Serial.println(celsius);
}