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
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
It is no other way to read analog values than setting up the SAADC. Please post the errors you are facing, and I will try to help you get it working. Please also have a look at the SAADC example in our SDK, and these examples on GitHub about how to use the SAADC peripheral.
I am working on Visual Studio. So I am unable to open the sample SAADC project.
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
Command line-action failed Build has failed These are the errors I am getting
I don't see your errors here, but I got one on e-mail. 'TIMER_DEFAULT_CONFIG_FREQUENCY
is not defined in nfr_drv_timer.h, it is only used here. This NRF_CONFIG macro should be defined in sdk_config.h. If you do not have the nrf_drv_timer part in your sdk_config.h file, you need to copy this from the full sdk_config.h file found in nRF5_SDK_13.0.0\config\sdk_config.h
. You can also find the correct settings for SAADC example in nRF5_SDK_13.0.0\examples\peripheral\saadc\pca10056\blank\config\sdk_config.h
.