// Relay.ino
//
// 6 Febrary 2022, Version 1, by Koepel, Public Domain
//
// Using a relay to turn on one of two leds.
//
const float BETA = 3950; // should match the Beta Coefficient of the thermistor
const int relayPin = 13;//
void setup() {
Serial.begin(9600);
pinMode( relayPin, OUTPUT);
}
void loop() {
int analogValue = analogRead(A0);
digitalWrite( relayPin, HIGH);
delay( 600);
digitalWrite( relayPin, LOW);
delay( 600);
float celsius = 1 / (log(1 / (1023. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15;
Serial.print("Temperature: ");
Serial.print(celsius);
Serial.println(" ℃");
delay(1500);
}