adafruit / adafruit/DHT-sensor-library
Doesn't function for blackpill stm32f401ccu6
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I would like to ask why it show some error in library.
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp: In constructor 'DHT::DHT(uint8_t, uint8_t, uint8_t)':
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp:51:37: error: 'microsecondsToClockCycles' was not declared in this scope
microsecondsToClockCycles(1000); // 1 millisecond timeout for
^
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp: In member function 'float DHT::readTemperature(bool, bool)':
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp:112:13: error: 'word' was not declared in this scope
f = ((word)(data[2] & 0x7F)) << 8 | data[3];
^
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp: In member function 'float DHT::readHumidity(bool)':
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp:158:13: error: 'word' was not declared in this scope
f = ((word)data[0]) << 8 | data[1];
^
c:\Users\User\OneDrive\ ĵ \Arduino\libraries\DHT_sensor_library\DHT.cpp:158:18: error: expected ')' before 'data'
f = ((word)data[0]) << 8 | data[1];
^
grpc: error while marshaling: string field contains invalid UTF-8
Compilation error: grpc: error while marshaling: string field contains invalid UTF-8
Contributor guide
Research direction
Start by reproducing the Blackpill STM32F401CCU6 compilation failure and inspect DHT.cpp at the reported lines 51, 112, and 158. Check how this Arduino library is expected to provide microsecondsToClockCycles and word for that target; done means the library compiles without these errors and the reported marshaling failure no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- arduino, cpp
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100