ni-c / heimcontrol.js

Home-Automation with node.js and Raspberry PI
MIT License
1.41k stars 297 forks source link

How to read values from DHT22 Temperature/Humidity sensor #78

Open pharmak0n opened 10 years ago

pharmak0n commented 10 years ago

Hi, I'm trying to use this very common sensor , but do not know how to do because it uses a function to retrieve values ​​instead of analogRead. Am I wrong? How can I read values ​​from sensors that are in these cases?

// Example testing sketch for various DHT humidity/temperature sensors

include "DHT.h"

DHT dht(A0, DHT22);

void setup() { Serial.begin(9600); dht.begin(); }

void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); }

tjanson commented 10 years ago

Possibly relevant: https://github.com/qrof/heimcontrol.js/tree/master/plugins/dht22