/*
Example using DHTlib
*/
#include "dht.h"
#include <TinyDebug.h>
#define DHTPIN PB3 // Digital pin connected to the DHT sensor
dht DHT;
void setup() {
Debug.begin();
}
void loop() {
// Wait a few seconds between measurements.
delay(2000);
int check = DHT.read22(DHTPIN); // 0 = no errors
int tempC = DHT.temperature; // Celsius
int tempF = (DHT.temperature * 1.8) + 32; // Fahrenheit
int hum = DHT.humidity;
// To convert Celsius to Fahrenheit,
// °F = (°C × 1.8) + 32
Debug.print("check: "); Debug.println(check);
Debug.print("tempC: "); Debug.println(tempC);
Debug.print("tempF: "); Debug.println(tempF);
Debug.print("hum: "); Debug.println(hum);
}