hi
I need to set a pin high when i make a connection to the device .so i set to output direction in main.c file.i have include gpio.h and nrf_delay.h file in main file
nrf_gpio_pin_dir_set(29,NRF_GPIO_PIN_DIR_OUTPUT); //red led
nrf_delay_ms(100);
then i set the pin in ble_evt_handler as
case BLE_GAP_EVT_DISCONNECTED:
nrf_gpio_pin_clear(29);
SEGGER_RTT_printf(0,"Disconnected\n");
break;
case BLE_GAP_EVT_CONNECTED:
nrf_gpio_pin_set(29);
SEGGER_RTT_printf(0,"Connected..\n");
err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
APP_ERROR_CHECK(err_code);
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
break;
though i have set pin ,this pin gets cleared when i connect device using nRF connect (i.e exactly reverse action happens).i have checked that assiging pin as output sets high on this pin
where could be the problem?