Skip to content

Commit fcd865b

Browse files
committed
Update example to note cycle threshold parameter for Arduino Due.
1 parent 7f7425f commit fcd865b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/DHTtester/DHTtester.ino

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,22 @@
1111
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
1212

1313
// Connect pin 1 (on the left) of the sensor to +5V
14+
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
15+
// to 3.3V instead of 5V!
1416
// Connect pin 2 of the sensor to whatever your DHTPIN is
1517
// Connect pin 4 (on the right) of the sensor to GROUND
1618
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
1719

20+
// Initialize DHT sensor for normal 16mhz Arduino
1821
DHT dht(DHTPIN, DHTTYPE);
22+
// NOTE: For working with a faster chip, like an Arduino Due or Teensy, you
23+
// might need to increase the threshold for cycle counts considered a 1 or 0.
24+
// You can do this by passing a 3rd parameter for this threshold. It's a bit
25+
// of fiddling to find the right value, but in general the faster the CPU the
26+
// higher the value. The default for a 16mhz AVR is a value of 6. For an
27+
// Arduino Due that runs at 84mhz a value of 30 works.
28+
// Example to initialize DHT sensor for Arduino Due:
29+
//DHT dht(DHTPIN, DHTTYPE, 30);
1930

2031
void setup() {
2132
Serial.begin(9600);

0 commit comments

Comments
 (0)