Quantcast
Channel: Seeedstudio Forum
Viewing all articles
Browse latest Browse all 6612

Connecting 2 Grove devices to Stalker 3.0

$
0
0
byronjbignell wrote:Hi, I'd tried 7 in a previous iteration, this is the result. I'd thought perhaps that the DHT11 was a dud, so I've tried three different ones, all result in the same issue.


Code:
  float h = dht.readHumidity();
  // Read temperature as Celsius
  float t = dht.readTemperature();
  // Read temperature as Fahrenheit
  float f = dht.readTemperature(true);
  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(t) || isnan(f)) {
    Serial.println(h);
    Serial.println(t);
    Serial.println(f);
    Serial.println("Failed to read from DHT sensor!");
    return;
  }



Code: DHT11 test result

nan
0.00
32.00

Failed to read from DHT sensor!


Be careful the type of sensor:

Code: // Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include "DHT.h"

#define DHTPIN A0     // what pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11   // DHT 11
#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)



Try this code first, may it can solve your problem.

Bty, the pins of digital 7 and digital 8 are both pointed on the stalker v3 from ATmega328.

Jacket

Statistics : Posted by byronjbignell • on Sat Jan 03, 2015 5:33 pm • Replies 8 • Views 372

Viewing all articles
Browse latest Browse all 6612

Trending Articles