User Tools

Site Tools


openhw:arduino:εξαρτήματα:αισθητήρες:θερμοκρασίας:tmp36

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
openhw:arduino:εξαρτήματα:αισθητήρες:θερμοκρασίας:tmp36 [2026/06/12 17:51] – [Προδιογραφές TMP36] alexandrospropenhw:arduino:εξαρτήματα:αισθητήρες:θερμοκρασίας:tmp36 [2026/06/12 18:03] (current) – [Πρόσβαση από το Sketch] alexandrospr
Line 45: Line 45:
  
  <code cpp>  <code cpp>
-// Define the analog pin, the TMP36'Vout pin is connected to+// Ορίζουμε τον αναλογικό ακροδέκτη της πλακέτας arduino στην οποία συνδέσαμε τον ακροδέκτη εξόδου του TMP36's
 #define sensorPin A0 #define sensorPin A0
  
 void setup() { void setup() {
-  // Begin serial communication at 9600 baud rate+  // Ξεκινάμε επικοινωνία με την κονσόλα του IDE.
   Serial.begin(9600);   Serial.begin(9600);
 } }
  
 void loop() { void loop() {
-  // Get the voltage reading from the TMP36+  // Λήψη της τιμής του ακροδέκτη εξόδου του TMP36
   int reading = analogRead(sensorPin);   int reading = analogRead(sensorPin);
  
-  // Convert that reading into voltage +  // Μετατροπή της τιμής σε τάση.
-  // Replace 5.0 with 3.3, if you are using a 3.3V Arduino+
   float voltage = reading * (5.0 / 1024.0);   float voltage = reading * (5.0 / 1024.0);
  
-  // Convert the voltage into the temperature in Celsius+  // Μετατροπή της τάσης σε θερμοκρασία Κελσίου
   float temperatureC = (voltage - 0.5) * 100;   float temperatureC = (voltage - 0.5) * 100;
  
-  // Print the temperature in Celsius +  // Εμφάνιση της θερμοκρασίας σε Κελσίου 
-  Serial.print("Temperature: ");+  Serial.print("θερμοκρασία: ");
   Serial.print(temperatureC);   Serial.print(temperatureC);
-  Serial.print("\xC2\xB0"); // shows degree symbol+  Serial.print("\xC2\xB0"); // σύμβολο θερμοκρασίας
   Serial.print(" |  ");   Serial.print(" |  ");
      
-  // Print the temperature in Fahrenheit 
-  float temperatureF = (temperatureC * 9.0 / 5.0) + 32.0; 
-  Serial.print(temperatureF); 
-  Serial.print("\xC2\xB0"); // shows degree symbol 
-  Serial.println("F"); 
  
-  delay(1000); // wait a second between readings+  delay(1000); // αναμονή ενός δευτερολέπτου πριν νέα ανάγνωση τιμής
 } }
 } }
openhw/arduino/εξαρτήματα/αισθητήρες/θερμοκρασίας/tmp36.1781286664.txt.gz · Last modified: by alexandrospr

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki