Skip to content

Read Temperature #2

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions