Compare commits

...

9 Commits

Author SHA1 Message Date
dherrada
be6915c60d Update CI action versions 2023-05-12 11:24:12 -04:00
Eva Herrada
b2be3b193b
Bump to 1.4.4 2022-06-27 14:05:27 -04:00
Limor "Ladyada" Fried
5273ef06a8
Merge pull request #191 from ondras12345/unknown-F_CPU
Fix infinite loop on STM32F103
2022-06-25 21:18:53 -04:00
Ondřej Sluka
2470b8a3a1 Fix infinite loop on STM32F103
When trying to read temperature from a DHT11 when the sensor was
disconnected, the program would encounter an infinite loop in
DHT::expectPulse, because count would keep overflowing.
2022-06-25 19:46:56 +02:00
Dylan Herrada
ce31485de7
Bump to 1.4.3 2021-10-25 15:56:26 -04:00
Limor "Ladyada" Fried
c14960c223
Merge pull request #189 from klone52/patch-1
Fix comment on DHT22 and DHT21 variables
2021-10-25 14:26:26 -04:00
Nicolas Hernandez
880538fa12
Fix comment on DHT22 and DHT21 variables 2021-10-24 21:27:23 -03:00
Limor "Ladyada" Fried
cf2346e7c1
Merge pull request #188 from phd/phd-const-sensors-types
Use const instead of defines for sensors types
2021-10-23 11:46:30 -04:00
Piotr Henryk Dabrowski
bd145c5449 Use const instead of defines for sensors types 2021-10-21 10:39:47 +02:00
4 changed files with 12 additions and 10 deletions

View File

@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
path: ci

View File

@ -360,7 +360,9 @@ bool DHT::read(bool force) {
// in the very latest IDE versions):
// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
uint32_t DHT::expectPulse(bool level) {
#if (F_CPU > 16000000L)
// F_CPU is not be known at compile time on platforms such as STM32F103.
// The preprocessor seems to evaluate it to zero in that case.
#if (F_CPU > 16000000L) || (F_CPU == 0L)
uint32_t count = 0;
#else
uint16_t count = 0; // To work fast enough on slower AVR boards

10
DHT.h
View File

@ -41,11 +41,11 @@
#endif
/* Define types of sensors. */
#define DHT11 11 /**< DHT TYPE 11 */
#define DHT12 12 /**< DHY TYPE 12 */
#define DHT22 22 /**< DHT TYPE 22 */
#define DHT21 21 /**< DHT TYPE 21 */
#define AM2301 21 /**< AM2301 */
static const uint8_t DHT11{11}; /**< DHT TYPE 11 */
static const uint8_t DHT12{12}; /**< DHY TYPE 12 */
static const uint8_t DHT21{21}; /**< DHT TYPE 21 */
static const uint8_t DHT22{22}; /**< DHT TYPE 22 */
static const uint8_t AM2301{21}; /**< AM2301 */
#if defined(TARGET_NAME) && (TARGET_NAME == ARDUINO_NANO33BLE)
#ifndef microsecondsToClockCycles

View File

@ -1,5 +1,5 @@
name=DHT sensor library
version=1.4.2
version=1.4.4
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors