The following variables are automatically generated and updated when changes are made to the Thing
float cels;
float humid;
float temp;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
void setup() {
Serial.begin(9600);
dht.begin();
// Defined in thingProperties.h
// int Properties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
/*
* maxbeast41
*/
// DHT sensor library - Version: Latest
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN 13
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
/*
Sketch generated by the Arduino IoT Cloud Thing "Untitled"
https://create.arduino.cc/cloud/things/ed32e1a5-8185-49f6-a922-5eb7819b2b4f
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
float cels;
float humid;
float temp;
Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
which are called when their values are changed from the Dashboard.
These functions are generated with the Thing and added at the end of this sketch.
*/
#include "thingProperties.h"
void setup() {
Serial.begin(9600);
dht.begin();
// Defined in thingProperties.h
// int Properties();
// Connect to Arduino IoT Cloud
ArduinoCloud.begin(ArduinoIoTPreferredConnection);
/*
The following function allows you to obtain more information
related to the state of network and IoT Cloud connection and errors
the higher number the more granular information you’ll get.
The default is 0 (only errors).
Maximum is 4
*/
setDebugMessageLevel(2);
ArduinoCloud.printDebugInfo();
}
void loop() {
ArduinoCloud.update();
delay(10000);
cels = dht.readTemperature();
humid = dht.readHumidity();
temp = cels * 1.8 + 32;
Serial.println(temp);
Serial.println(humid);
}