Hello, I'm a beginner in embedded systems programming. In my current project I want to read the voltage at an analog input pin and print it somewhere to check the reading, I use the S32K311. I would need some examples because I don't know how to initialise the ADC i already routed the pin in the PINS section and updated the code, but I can't find functions to read the analg input. Please provide me some help.
Hi @SAL_111,
The RTD packages include various examples for the modules. Have you used the ADC example as reference?
It shows how to use the APIs to configure, calibrate and start a conversion for the ADC:
Best regards,
Julián
Hi @SAL_111,
I'm not sure I understand, why is this example not valid for you? The example configures one ADC channel and reads the value for it in the notification function. You can simply modify the channel used for whichever channel you need to read.
For example, in the S32K344 EVB board, the included potentiometer is wired to ADC1_S10 (channel 34). You can simply modify the example to measure ADC1_S10 instead:
Best regards,
Julián