what is code for ADC data on coapp(Single channel)?
what is code for ADC data on coapp(Single channel)?
I have made an example, but I have not tested it (I don't have a IoT setup to test on), but I checked that the example compiles and runs.
You need to copy the ADC driver and HAL from SDK 11.0.0 into your nRF51 IoT SDK directory:
Copy the directory components\drivers_nrf\adc
from SDK 11.0.0 to Nordic\nrf51\components\drivers_nrf
in nRF51 IoT SDK v0.8.0.
Copy the files nrf_adc.c
and nrf_adc.h
from components\drivers_nrf\hal\
in SDK 11.0.0 into directory Nordic\nrf51\components\drivers_nrf\hal
in nRF51 IoT SDK v0.8.0.
Best regards,
Jørgen
Where did you place the example? It should be extracted in nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\examples\iot
and the main.c file should then be found in nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\examples\iot\coap_adc\ipv6\server
. Is this how your setup looks? If it is not placed in the correct directory, your project will not find the files, as the paths are relative.
Also, make sure you added the path to the adc header files to your project as this:
And that you have all the following files (in the specified path):
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\adc\nrf_drv_adc.c
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\adc\nrf_drv_adc.h
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\hal\nrf_adc.c
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\hal\nrf_adc.h
Where did you place the example? It should be extracted in nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\examples\iot
and the main.c file should then be found in nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\examples\iot\coap_adc\ipv6\server
. Is this how your setup looks? If it is not placed in the correct directory, your project will not find the files, as the paths are relative.
Also, make sure you added the path to the adc header files to your project as this:
And that you have all the following files (in the specified path):
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\adc\nrf_drv_adc.c
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\adc\nrf_drv_adc.h
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\hal\nrf_adc.c
nrf51_iot_sdk_0.8.0_f1f6187\Nordic\nrf51\components\drivers_nrf\hal\nrf_adc.h