add dht22 and RHT03 support

This commit is contained in:
Harald Pichler 2013-11-07 16:34:28 +01:00
parent 8f85f7fb0a
commit 45ede69308
3 changed files with 27 additions and 22 deletions

View file

@ -72,7 +72,7 @@
#endif
#if REST_RES_DHT11
#include "dev/dht11.h"
uint8_t dht11_temp=0, dht11_hum=0;
uint16_t dht11_temp=0, dht11_hum=0;
#endif
#if defined (PLATFORM_HAS_BUTTON)
@ -141,7 +141,7 @@ info_handler(void* request, void* response, uint8_t *buffer, uint16_t preferred_
/* Some data that has the length up to REST_MAX_CHUNK_SIZE. For more, see the chunk resource. */
// jSON Format
index += sprintf(message + index,"{\n \"version\" : \"V0.3\",\n");
index += sprintf(message + index,"{\n \"version\" : \"V0.4\",\n");
index += sprintf(message + index," \"name\" : \"6lowpan-climate\"\n");
index += sprintf(message + index,"}\n");
@ -691,8 +691,7 @@ hw_init()
ds1820_temp();
#endif
#if REST_RES_DHT11
dht11_temp=DHT_Read_Data(DHT_Temp);
dht11_hum=DHT_Read_Data(DHT_RH);
DHT_Read_Data(&dht11_temp, &dht11_hum);
#endif
}
#define MESURE_INTERVAL (20 * CLOCK_SECOND)
@ -802,8 +801,7 @@ PROCESS_THREAD(rest_server_example, ev, data)
PRINTF("Periodic\n");
etimer_reset(&ds_periodic_timer);
#if REST_RES_DHT11
dht11_temp=DHT_Read_Data(DHT_Temp);
dht11_hum=DHT_Read_Data(DHT_RH);
DHT_Read_Data(&dht11_temp, &dht11_hum);
#endif
#if REST_RES_DS1820
if(ds1820_convert()){