@@ -76,8 +76,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
76
76
{
77
77
if (!initDHT0)
78
78
{
79
- if (type!=DHT11)
80
- portFix (port);
81
79
initDHT0=true ;
82
80
dht0 = new DHT_Unified (0 , type);
83
81
dht0->begin ();
@@ -88,8 +86,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
88
86
{
89
87
if (!initDHT1)
90
88
{
91
- if (type!=DHT11)
92
- portFix (port);
93
89
initDHT1=true ;
94
90
dht1 = new DHT_Unified (1 , type);
95
91
dht1->begin ();
@@ -100,8 +96,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
100
96
{
101
97
if (!initDHT2)
102
98
{
103
- if (type!=DHT11)
104
- portFix (port);
105
99
initDHT2=true ;
106
100
dht2 = new DHT_Unified (2 , type);
107
101
dht2->begin ();
@@ -112,8 +106,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
112
106
{
113
107
if (!initDHT3)
114
108
{
115
- if (type!=DHT11)
116
- portFix (port);
117
109
initDHT3=true ;
118
110
dht3 = new DHT_Unified (3 , type);
119
111
dht3->begin ();
@@ -127,8 +119,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
127
119
{
128
120
if (!initDHT4)
129
121
{
130
- if (type!=DHT11)
131
- portFix (port);
132
122
initDHT4=true ;
133
123
dht4 = new DHT_Unified (4 , type);
134
124
dht4->begin ();
@@ -139,8 +129,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
139
129
{
140
130
if (!initDHT5)
141
131
{
142
- if (type!=DHT11)
143
- portFix (port);
144
132
initDHT5=true ;
145
133
dht5 = new DHT_Unified (5 , type);
146
134
dht5->begin ();
@@ -154,8 +142,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
154
142
{
155
143
if (!initDHT6)
156
144
{
157
- if (type!=DHT11)
158
- portFix (port);
159
145
initDHT6=true ;
160
146
dht6 = new DHT_Unified (6 , type);
161
147
dht6->begin ();
@@ -166,8 +152,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
166
152
{
167
153
if (!initDHT7)
168
154
{
169
- if (type!=DHT11)
170
- portFix (port);
171
155
initDHT7=true ;
172
156
dht7 = new DHT_Unified (7 , type);
173
157
dht7->begin ();
@@ -178,8 +162,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
178
162
{
179
163
if (!initDHT8)
180
164
{
181
- if (type!=DHT11)
182
- portFix (port);
183
165
initDHT8=true ;
184
166
dht8 = new DHT_Unified (8 , type);
185
167
dht8->begin ();
@@ -190,8 +172,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
190
172
{
191
173
if (!initDHT9)
192
174
{
193
- if (type!=DHT11)
194
- portFix (port);
195
175
initDHT9=true ;
196
176
dht9 = new DHT_Unified (9 , type);
197
177
dht9->begin ();
@@ -205,8 +185,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
205
185
{
206
186
if (!initDHT10)
207
187
{
208
- if (type!=DHT11)
209
- portFix (port);
210
188
initDHT10=true ;
211
189
dht10 = new DHT_Unified (10 , type);
212
190
dht10->begin ();
@@ -217,8 +195,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
217
195
{
218
196
if (!initDHT11)
219
197
{
220
- if (type!=DHT11)
221
- portFix (port);
222
198
initDHT11=true ;
223
199
dht11 = new DHT_Unified (11 , type);
224
200
dht11->begin ();
@@ -229,8 +205,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
229
205
{
230
206
if (!initDHT12)
231
207
{
232
- if (type!=DHT11)
233
- portFix (port);
234
208
initDHT12=true ;
235
209
dht12 = new DHT_Unified (12 , type);
236
210
dht12->begin ();
@@ -241,8 +215,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
241
215
{
242
216
if (!initDHT13)
243
217
{
244
- if (type!=DHT11)
245
- portFix (port);
246
218
initDHT13=true ;
247
219
dht13 = new DHT_Unified (13 , type);
248
220
dht13->begin ();
@@ -253,8 +225,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
253
225
{
254
226
if (!initDHT14)
255
227
{
256
- if (type!=DHT11)
257
- portFix (port);
258
228
initDHT14=true ;
259
229
dht14 = new DHT_Unified (14 , type);
260
230
dht14->begin ();
@@ -265,8 +235,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
265
235
{
266
236
if (!initDHT15)
267
237
{
268
- if (type!=DHT11)
269
- portFix (port);
270
238
initDHT15=true ;
271
239
dht15 = new DHT_Unified (15 , type);
272
240
dht15->begin ();
@@ -277,8 +245,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
277
245
{
278
246
if (!initDHT16)
279
247
{
280
- if (type!=DHT11)
281
- portFix (port);
282
248
initDHT16=true ;
283
249
dht16 = new DHT_Unified (16 , type);
284
250
dht16->begin ();
@@ -287,14 +253,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
287
253
}
288
254
}
289
255
290
- void SensorDHT::portFix (uint8_t port)
291
- {
292
- pinMode (port, OUTPUT);
293
- digitalWrite (port, LOW);
294
- delay (20 );
295
- pinMode (port, INPUT);
296
- }
297
-
298
256
void SensorDHT::preCycle (int cycleId)
299
257
{
300
258
}
0 commit comments