Skip to content

Instantly share code, notes, and snippets.

@Drvanon
Forked from anonymous/mine.cpp
Last active August 29, 2015 14:08
Show Gist options
  • Save Drvanon/61dc25958965a1a8231b to your computer and use it in GitHub Desktop.
Save Drvanon/61dc25958965a1a8231b to your computer and use it in GitHub Desktop.
#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