This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I want to read analog voltage applied to pin on nrf52840. Please help

Is there any simple way of reading analog values from pin. Setting up SAADC is giving too much of errors like command line action failed or any variable is undeclared whose header file is correctly included

Parents
  • You can still look at the source files? What is the errors you are seeing?

    To use the SAADC peripheral driver, you should only have to include the HAL and driver source files to your project, and add the path to the header files (found in same directory as source files) to your include paths:

    [SDK_ROOT]\components\drivers_nrf\hal\nrf_saadc.c
    [SDK_ROOT]\components\drivers_nrf\saadc\nrf_drv_saadc.c
    

    In addition, you need to enable the peripheral in sdk_config.h, by setting:

    #define SAADC_ENABLED 1
    
Reply
  • You can still look at the source files? What is the errors you are seeing?

    To use the SAADC peripheral driver, you should only have to include the HAL and driver source files to your project, and add the path to the header files (found in same directory as source files) to your include paths:

    [SDK_ROOT]\components\drivers_nrf\hal\nrf_saadc.c
    [SDK_ROOT]\components\drivers_nrf\saadc\nrf_drv_saadc.c
    

    In addition, you need to enable the peripheral in sdk_config.h, by setting:

    #define SAADC_ENABLED 1
    
Children
No Data
Related