An STM32 HAL library for the SHT2x temperature/humidity sensor series. Tested on an SHT20.
- Minimal setup:
_________
N/C 4 --| |_____| |-- 3 N/C
VDD 5 --| |-- 2 GND
SDA1 6 --|_________|-- 1 SCL1
- In STM32CubeIDE, include
sht2x_for_stm32_hal.h
andsht2x_for_stm32_hal.c
. - Complie and flash
main.c
in./examples
to microcontroller. - Read the results from a UART monitor.
- Refer to datasheets for further information.
- Replaced binary values with hexadecimal for compatibility with Keil.
- Moved user I2C handle definition from .h header to .c file to prevent multiple definition error. Made definition in .h header
extern
.