Here’s a program that tests the buttons,

int main(void){    // Configure LED-pins as outputs, and buttons as inputs with pullup    nrf_gpio_range_cfg_input(BUTTON_START, BUTTON_STOP, BUTTON_PULL); nrf_gpio_range_cfg_output(LED_START, LED_STOP);      while (true)    { if (! nrf_gpio_pin_read(BUTTON_0))  nrf_gpio_pin_set(LED_0);  else  nrf_gpio_pin_clear(LED_0); if (! nrf_gpio_pin_read(BUTTON_1))  nrf_gpio_pin_set(LED_1);  else  nrf_gpio_pin_clear(LED_1);    }}

Leave a Reply