Exemple #1
0
void cmd_sensor(Stream * chp, int argc, char * argv[])
{
	float temperature, humidity;

	
	if (dht.readData() == ERROR_NONE)
  {
		temperature = dht.ReadTemperature(CELCIUS);
		humidity = dht.ReadHumidity();
		
		chp->printf("Temperature %.2fC \r\n", temperature);
    chp->printf("Humidity %.2f%% \r\n", humidity);
		chp->printf("Dew point %.2f\r\n", dht.CalcdewPoint(temperature, humidity));
  }
}