Browse Source

Update 'thermokrasia.ino'

master
StratosKarvounis 4 years ago
parent
commit
21a77ca2d1
  1. 13
      thermokrasia.ino

13
thermokrasia.ino

@ -1,16 +1,14 @@
//TMP36 Pin Variables //TMP36 Pin Variables
int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to int sensorPin = 0; //sindesi stin analogiki porta 0
//the resolution is 10 mV / degree centigrade with a
//500 mV offset to allow for negative temperatures
/* /*
* setup() - this function runs once when you turn your Arduino on * setup() - this function runs once when you turn your Arduino on
* We initialize the serial connection with the computer
*/
void setup() void setup()
{ {
Serial.begin(9600); //Start the serial connection with the computer Serial.begin(9600); //Start the serial connection with the computer
//to view the result open the serial monitor
} }
void loop() // run over and over again void loop() // run over and over again
@ -23,7 +21,8 @@ void loop() // run over and over again
voltage /= 1024.0; voltage /= 1024.0;
// print out the voltage // print out the voltage
Serial.print(voltage); Serial.println(" volts"); Serial.print(voltage);
Serial.println(" volts");
// now print out the temperature // now print out the temperature
float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset float temperatureC = (voltage - 0.5) * 100 ; //converting from 10 mv per degree wit 500 mV offset

Loading…
Cancel
Save