You are not calling DHT.begin()
in setup()
.
This was a requirement introduced some time before 1.2.1-rc.3 where the use of pinMode()
and digitalWrite()
became “illegal” in an object constructor (v0.0.8)
With 0.0.11 you should also have a delay(1000)
after that, with 0.0.12 I’ll have that already incorporated in DHT.begin()
.
Additionally, this syntax has been outdated for years now
Particle.variable("ROOM_Temp2", &ROOMTemp2, DOUBLE);
Particle.variable("ROOM_Humid", &ROOMHumi, DOUBLE);
Particle.variable("ROOM_Tout", &ROOMTout, DOUBLE);
this would not be written simpler like this
Particle.variable("ROOM_Temp2", ROOMTemp2);
Particle.variable("ROOM_Humid",ROOMHumi);
Particle.variable("ROOM_Tout", ROOMTout);
Also, any variable that should store millis()
values needs to be declared as uint32_t
and not as int
.