#include <dht11.h>
#include<stdio.h>
#define DHT11PIN 2
dht11 DHT11;
char dataout[7];
void setup()
{
Serial.begin(9600);
}
double Fahrenheit(double celsius)
{
return 1.8 * celsius + 32;
}
void loop()
{
int chk = DHT11.read(DHT11PIN);
sprintf(dataout, "%03d,%03d",DHT11.humidity,DHT11.temperature);
Serial.println(dataout);
}
Tidak ada komentar:
Posting Komentar