Commit 47044e74 by hamara

Add new file

parents
Showing with 39 additions and 0 deletions
#define aref_voltage 3.3
int tempPin = A1;
int tempReading;
void setup(void) {
Serial.begin(9600);
analogReference(EXTERNAL);
}
void loop(void) {
tempReading = analogRead(tempPin);
Serial.print("Temp reading = ");
Serial.print(tempReading);
float voltage = tempReading * aref_voltage;
voltage /= 1024.0;
Serial.print(" - ");
Serial.print(voltage); Serial.println(" volts");
float temperatureC = (voltage - 0.5) * 100 ;
degrees ((volatge - 500mV) times 100)
Serial.print(temperatureC); Serial.println(" degrees C");
delay(1000);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment