Hello, I am using external interrupt from an ADXL345 . Can you tell me how to detect that external interrupt with the nRF51 ?
Hello, I am using external interrupt from an ADXL345 . Can you tell me how to detect that external interrupt with the nRF51 ?
Yes, add nrf_gpio_pin_set(LED_2);
below nrf_gpio_cfg_output(LED_2);
if you want it to be initially set to low. When you press Button 1 the led should toggle, switch off if it is on OR switch on it it is on.
can you explain "When you press Button 1 the led should toggle, switch off if it is on OR switch on it it is on"
i edited code but when i press button. LED don't ON
Replace
nrf_gpio_cfg_output(LED_2);
nrf_gpio_pin_set(LED_2);
with the following
nrf_drv_gpiote_out_config_t led_config = GPIOTE_CONFIG_OUT_TASK_LOW;
ret_code = nrf_drv_gpiote_out_init(LED_2, &led_config);
APP_ERROR_CHECK(ret_code);
In the event handler you replace
nrf_gpio_pin_toggle(LED_2);
with
nrf_drv_gpiote_out_toggle(LED_2);
Did this resolve you issue?