Skip to content

Commit

Permalink
Changed example sketch to display which model was detected
Browse files Browse the repository at this point in the history
Helps diagnose markruys#13
  • Loading branch information
liwenyip committed Jan 24, 2018
1 parent fdf9139 commit ff1c976
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/DHT_Test/DHT_Test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ void setup()
{
Serial.begin(9600);
Serial.println();
Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");

dht.setup(2); // data pin 2
if ( dht.getModel() == DHT::DHT11 ) {
Serial.println("Auto-detected DHT11");
} else if ( dht.getModel() == DHT::DHT22 ) {
Serial.println("Auto-detected DHT22");
}

Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");
}

void loop()
Expand Down

0 comments on commit ff1c976

Please sign in to comment.