The example initializes the SAADC driver and configures one channel to sample analog input 0 (GPIO pin 2).
I would like to know how to change analog input pin to other GPIOs like P0.00~P1.03
Like where in the code you change your GPIO pins?
Thanks.
The example initializes the SAADC driver and configures one channel to sample analog input 0 (GPIO pin 2).
I would like to know how to change analog input pin to other GPIOs like P0.00~P1.03
Like where in the code you change your GPIO pins?
Thanks.
Hi @cpeng,
To change the analog input pin been set in the example code , you need to update it in this function :
NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE();
For the possible values for (PIN_N) to this function :
nrf_saadc_channel_config_t channel_config =
NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(PIN_N);
Check here :
And for the mapping to the nrf52840 dk , check here :
infocenter.nordicsemi.com/.../hw_analog_pins.html
Best regards,
Abdelali