Serial.println("Error reading the sensor") if an error is detected, a error message is displayed here Checking if the measurements have passed without errors Two seconds pause between measurements so that a new measurement can be acquired on the next run. There is a pause of 2 seconds between measurements, The program starts the measurement and reads out the measured values Serial.println("KY-015 test - temperature and humidity test:") Here the respective input pin can be declared Alternatively, it is also included in the download package below. Therefore, download the library and unpack it into your Arduino library folder, which by default is located at (C:\User\Documents\Arduino\libraries). The example below uses the mentioned library. This sensor does not output its measurement result as an analog signal to an output pin, but communicates it digitally encoded. Pin assignment Code example Arduino Pin assignment Arduino Arduinoįor the following code example an additional library is needed: This sensor is therefore particularly suitable for long-term measurements. The disadvantage is the low sampling rate of the measurement, so that only every 2 seconds a new measurement result is available.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |