STM32 library for the I2C temperature sensor Analog Device ADT7410 or ADT7420
- Conversion mode : Continous
- Interrupt Mode
- Resolution : 13 bits
- Continous Conversion
- SCL frequency : up to 400 kHz
These pins can be configured according to the temperature detection registers (high, low, critical and hysteresis). You will find all associated functions in the source code.
This IC can be configured in 13bits or 16bits. The temperature value will be automatically calculated according to the resolution setting.
#include "ADT74x0.h"
ADT74X0 temp;
int main(void) {
temp.adti2c = &hi2c1; // Your I2C Handler
ADT74x0_Init(&temp, 0x48); // I2C address depends of A0 and A1 pins
ADT74x0_Reset(&temp); // Optional
ADT74x0_SetResolution(&temp, ADT74X0_16BITS); // Put the device in 16 bits resolution
if (ADT74x0_ReadTemp(&temp) != HAL_OK) {
Error_Handler();
}
printf("Raw value : %d - Temperature Value : %f\r\n", temp.raw_data, temp.deg_data);
}
👤 Axel Chabot
- Github: @axoulc
Give a ⭐️ if this project helped you!
Copyright © 2021 Axel Chabot.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator