Created
February 1, 2016 17:13
-
-
Save zach-c-d/771cabe16f84673537e3 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
int tempPin = 9;//temperature sensor is in pin 0 | |
float tempC = 0; //stores temperature sensor input data | |
void setup() { | |
analogReference(INTERNAL); | |
Serial.begin(9600); //opens serial communication | |
pinMode(tempPin, INPUT); | |
} | |
void loop() { | |
tempC = analogRead(tempPin); //reads tempPin data and stores in tempC | |
//tempC = (5*tempC*100.0)/1024.0; //converts tempPin data to celsius | |
Serial.println(tempC); | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment