Skip to content

Commit

Permalink
Ajout d'un exemple de code relatif au DHT11
Browse files Browse the repository at this point in the history
Un petit exemple sur l'utilisation d'un DHT11/DHT22,
donnant la température et l'hygrométrie, toutes les 2s.
  • Loading branch information
sarinkhan committed Jun 19, 2013
1 parent 71860c5 commit cb64cf0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions DHT11.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <dht.h>
#define dht_dpin A2
dht DHT;
void setup()
{
Serial.begin(9600);
}

void loop()
{
DHT.read11(dht_dpin);

float h = DHT.humidity;
float t = DHT.temperature;
Serial.print("Temperature : ");
Serial.println(t);
Serial.print("Hygrometrie : ");
Serial.print(h);
Serial.println("\%");
delay(1000);
}

0 comments on commit cb64cf0

Please sign in to comment.