Skip to content

Instantly share code, notes, and snippets.

Created November 5, 2014 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4133ad12cce2f71ea3dc to your computer and use it in GitHub Desktop.
Save anonymous/4133ad12cce2f71ea3dc to your computer and use it in GitHub Desktop.
float tempC;
int reading;
int tempPin = 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