I'm fairly new to nRF ecosystem and embedded studio. I'm just trying to read GPIO read of my digital hall sensor. Can anyone find what am I doing wrong with my code? I just modified the example blinky code. I've connected the sensor in P0.10
#include <stdbool.h>
#include <stdint.h>
#include "nrf_delay.h"
#include "boards.h"
#include "nrf_gpio.h"
uint32_t j;
#define sensor 10
// #define sensor NRF_GPIO_PIN_MAP(0,10)
int main(void)
{
/* Configure board. */
bsp_board_leds_init();
nrf_gpio_cfg_input(sensor,NRF_GPIO_PIN_NOPULL);
/* Toggle LEDs. */
while (true)
{
j = nrf_gpio_pin_read(sensor);
printf("The value is: %d", j);
nrf_delay_ms(500);
if (j > 0)
{
bsp_board_led_on(0);
nrf_delay_ms(500);
}
}
}