Hi, I want to build a wifi weather station with arduino uno r4 wifi with Arduino IoT cloud, I connected a dht22 to arduino and wrote this code
`// Adafruit Unified Sensor - Version: Latest
#include <Adafruit_Sensor.h>
// DHT sensor library - Version: Latest
#include <DHT.h>
#include <DHT_U.h>
/*
Sketch generated by the Arduino IoT Cloud Thing "Temperature Monitor"
https://create.arduino.cc/cloud/things/6e4946f5-04a9-4315-859d-b40b86240260
Arduino IoT Cloud Variables description
The following variables are automatically generated and updated when changes are made to the Thing
CloudTemperatureSensor temperature;
int humidity;
bool LED;
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"
#include "DHT.h"
#define DHTPIN 11
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// Initialize serial and wait for port to open:
Serial.begin(9600);
dht.begin();
// This delay gives the chance to wait for a Serial Monitor without blocking if none is found
delay(1500);
// Defined in thingProperties.h
initProperties();
// 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();
float h = dht.readHumidity();
float t = dht.readTemperature();
// Your code here
temperatura = t;
umidita = h;
}
It gives me this error, how do I fix it?
/tmp/arduino-build-A4D1EDA6EDF608F83F64CA4374A560C7/sketch/objs.a(Untitled_jul27b.ino.cpp.o): In function `initProperties()':
/tmp/1628760945/Untitled_jul27b/thingProperties.h:27: undefined reference to `onUmiditaChange()'
/tmp/1628760945/Untitled_jul27b/thingProperties.h:27: undefined reference to `onLedChange()'
collect2: error: ld returned 1 exit status
Multiple libraries were found for "RTC.h"
Used: /home/builder/.arduino15/packages/arduino/hardware/renesas_uno/1.0.2/libraries/RTC
Not used: /home/builder/opt/libraries/m5stickcplus_0_0_8
Not used: /home/builder/opt/libraries/m5core2_0_1_5
Not used: /home/builder/opt/libraries/m5stickc_0_2_8
Not used: /home/builder/opt/libraries/m5station_0_0_1
Multiple libraries were found for "Adafruit_Sensor.h"
Used: /home/builder/opt/libraries/adafruit_unified_sensor_1_1_11
Not used: /home/builder/opt/libraries/arduav_1_4_2
Multiple libraries were found for "DHT.h"
Used: /home/builder/opt/libraries/dht_sensor_library_1_4_4
Not used: /home/builder/opt/libraries/ukit_explore_1_2_28
Not used: /home/builder/opt/libraries/dht11esp8266_1_0_10
Not used: /home/builder/opt/libraries/esp826611_1_0_16
Not used: /home/builder/opt/libraries/servodht11_1_0_10
Not used: /home/builder/opt/libraries/dht11esp8266examples_1_0_10
Not used: /home/builder/opt/libraries/grove_temperature_and_humidity_sensor_2_0_1
Not used: /home/builder/opt/libraries/dht118266_1_0_16
Not used: /home/builder/opt/libraries/nanoplayboard_0_1_1
Error during build: exit status 1
collect2: error: ld returned 1 exit status