Skip to content

Read Temperature #2

@henriBusch

Description

@henriBusch

Hello, first of all, big fan of the library. I need a way to read the temperature sensor permanently. How does everything need to be set up to make this work? I have enabled the temperature sensor mod by setting

#define CELSIUS_PER_LSB 0.0078125f

ADS1220_Parameter_t Parameter = {0};
...
Parameter.TempeSensorMode = 1;
...
ADS1220_Init(&Handler, &Parameter);
...
int32_t ADC_Data;
ADS1220_ReadData(&Handler, &ADC_Data);

Then in the while(1) I set everything like this.

float temp = ADCValueToTemperature(ADC_Data, CELSIUS_PER_LSB);
printf("ADC Raw: 0x%lx | Temperature in C : %f\r\n", (unsigned long)ADC_Data, temp);
HAL_Delay(4000);

The hardware is on AIN0-AIN3 and REFN0 and REFP0 are not connected. Could you give me an example? I work with the Cube IDE from STM

Thank you,
Henri

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions