mirror of
https://github.com/adafruit/DHT-sensor-library.git
synced 2023-10-23 22:20:38 +03:00
Update example to note cycle threshold parameter for Arduino Due.
This commit is contained in:
parent
7f7425f11e
commit
fcd865b3bc
@ -11,11 +11,22 @@
|
|||||||
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
|
//#define DHTTYPE DHT21 // DHT 21 (AM2301)
|
||||||
|
|
||||||
// Connect pin 1 (on the left) of the sensor to +5V
|
// Connect pin 1 (on the left) of the sensor to +5V
|
||||||
|
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
|
||||||
|
// to 3.3V instead of 5V!
|
||||||
// Connect pin 2 of the sensor to whatever your DHTPIN is
|
// Connect pin 2 of the sensor to whatever your DHTPIN is
|
||||||
// Connect pin 4 (on the right) of the sensor to GROUND
|
// Connect pin 4 (on the right) of the sensor to GROUND
|
||||||
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
|
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
|
||||||
|
|
||||||
|
// Initialize DHT sensor for normal 16mhz Arduino
|
||||||
DHT dht(DHTPIN, DHTTYPE);
|
DHT dht(DHTPIN, DHTTYPE);
|
||||||
|
// NOTE: For working with a faster chip, like an Arduino Due or Teensy, you
|
||||||
|
// might need to increase the threshold for cycle counts considered a 1 or 0.
|
||||||
|
// You can do this by passing a 3rd parameter for this threshold. It's a bit
|
||||||
|
// of fiddling to find the right value, but in general the faster the CPU the
|
||||||
|
// higher the value. The default for a 16mhz AVR is a value of 6. For an
|
||||||
|
// Arduino Due that runs at 84mhz a value of 30 works.
|
||||||
|
// Example to initialize DHT sensor for Arduino Due:
|
||||||
|
//DHT dht(DHTPIN, DHTTYPE, 30);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
Loading…
Reference in New Issue
Block a user