Skip to content
Snippets Groups Projects
Commit dc1ad1d1 authored by user2684's avatar user2684
Browse files

DHT object is always initialized to DHT22 #39

parent 3e3cf8d8
No related branches found
No related tags found
No related merge requests found
...@@ -1080,8 +1080,8 @@ int NodeManager::registerSensor(int sensor_type, int pin, int child_id) { ...@@ -1080,8 +1080,8 @@ int NodeManager::registerSensor(int sensor_type, int pin, int child_id) {
#endif #endif
#if MODULE_DHT == 1 #if MODULE_DHT == 1
else if (sensor_type == SENSOR_DHT11 || sensor_type == SENSOR_DHT22) { else if (sensor_type == SENSOR_DHT11 || sensor_type == SENSOR_DHT22) {
DHT* dht = new DHT(pin,DHT22);
int dht_type = sensor_type == SENSOR_DHT11 ? DHT11 : DHT22; int dht_type = sensor_type == SENSOR_DHT11 ? DHT11 : DHT22;
DHT* dht = new DHT(pin,dht_type);
registerSensor(new SensorDHT(child_id,pin,dht,0,dht_type)); registerSensor(new SensorDHT(child_id,pin,dht,0,dht_type));
child_id = _getAvailableChildId(); child_id = _getAvailableChildId();
return registerSensor(new SensorDHT(child_id,pin,dht,1,dht_type)); return registerSensor(new SensorDHT(child_id,pin,dht,1,dht_type));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment