HTU21D connection to STM32 (HAL): temperature and humidity sensor (SUB)
HTML-код
- Опубликовано: 9 ноя 2024
- Article (RU): cxemka.com/46-...
Buy HTU21D on Aliexpress (1.37$): ali.ski/rP0qGH
Buy HTU21D on Aliexpress (1.35$): ali.ski/JTbp6M
Buy HTU21D on Aliexpress (2.23$): ali.ski/prAxn
Как приятно смотреть, что сделано не на абдурино
Can you do a video about CO2 sensor CCS811 with STM32? I have some problems...
I don't have this sensor.
Thank you for the good video. I have a question. I don't know why HAL_I2C_Mem_Read doesn't work. Is INTERRUPT necessary? Thank you.
After working with this sensor I decided to not to use Mem_Read, because the sensor needs time to take measurements. I recommend to do like this:
(send_command)-(100 ms delay)-(read data)-(100 ms delay)...
Here interrupt it's not absolutely necessary.
CODE EXAMPLE:
/* Variables for HTU21D (tmp. sensor) */
uint8_t HTU21D_RX_Data[3];
float HTU21D_Temperature;
float HTU21D_Humidity;
uint16_t HTU21D_ADC_Raw;
uint8_t HTU21D_Temp_Cmd = 0xE3;
uint8_t HTU21D_Humi_Cmd = 0xE5;
#define HTU21D_ADRESS (0x40
@@cxemkacom3623 Thank you for your confirmation.
(HAL_I2C_Mem_Read) tried to add 100ms latency, but it did not work.
I don't think I understand the datasheet yet.
I'll try to activate the code you told me.
I appreciate your pointing it out to us.
Лучше все делать в варижках
Не работает ... ни в какую ... уже код с гитхаба взял ... всё равно не пашет!