Lets just stick to GPIO
-
I am trying to initialize multiple input buttons and multiple output LEDS.
-
I am trying to glow the LEDS with corresponding buttons. ex:- button 0 glows led0 and so on.
// Here i can only initialize single input and output But not multiple one. #ifdef BSP_LED_0 #define GPIO_OUTPUT_PIN_NUMBER BSP_LED_0 /**< Pin number for output. */ #endif
#ifndef GPIO_OUTPUT_PIN_NUMBER #error "Please indicate output pin" #endif
#ifdef BSP_BUTTON_0 #define GPIO_INPUT_PIN_NUMBER BSP_BUTTON_0 /**< Pin number for output. */ #endif
#ifndef GPIO_INPUT_PIN_NUMBER #error "Please indicate output pin" #endif
#define BSP_LED_0 #define BSP_LED_1 LED_2 #define BSP_BUTTON_0 #define BSP_BUTTON_1 BUTTON_2
int main(void) {
while(1) { if(BSP_BUTTON_0 == 1) // Here I am facing error every time { nrf_gpio_port_pin_toggle(BSP_LED_0); nrf_delay_ms(500); } }
} Explain my mistakes