-
-
Save Drvanon/61dc25958965a1a8231b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EEPROM.h> | |
float tempC; | |
int reading; | |
int tempPin = 0; | |
int EAdress = 0; | |
void setup () { | |
analogReference(INTERNAL); | |
} | |
void writeTemp(float temp) { | |
EEPROM.write(EAdress, temp); | |
EAdress += 4; | |
} | |
void loop () { | |
reading = analogRead(tempPin); | |
tempC = reading / 9.31; | |
writeTemp(tempC); | |
delay(15 * 60 * 1000 / 30); // 15 minutes * 60 seconds * 1000 milliseconds / 30 seconds | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment