Created
February 18, 2016 05:25
-
-
Save tristanm/5c943ec640556cf36a5c to your computer and use it in GitHub Desktop.
Revisions
-
tristanm created this gist
Feb 18, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ void setup() { pinMode(1, OUTPUT); } void loop() { if (getTemp() > 30) { digitalWrite(1, HIGH); } else { digitalWrite(1, LOW); } } int getTemp() { analogReference(INTERNAL1V1); int raw = analogRead(A0 + 15); int celcius = raw - 273; analogReference(DEFAULT); return celcius; }