how to READ data from input into STM32

Status
Not open for further replies.

hannachifaten

Member level 2
Joined
May 1, 2013
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,769
Hello every body ,
i neeeed help :/
my aim is to read a bit data from input pins and after that i will get this data to output such led , i want to try my leds
i configure my GPIO INPUT logic and out put push pull for led , but the code is seem to be wrong i 'didt find what is the problemme
i just need to write code to interface logic pin ; this is my code *
Code:
	int main( void) {
		/* initialize the GPIO pins we need  */
  init_GPIO();
  	  
  while (1) {	  
  				 
	 
  	if ((GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_0) == 1) )
 	{
          GPIOI->BSRRL = GPIO_Pin_10 ;
	}
    else 
 {
       GPIOI->BSRRH = GPIO_Pin_10 ;
    } 

	if ((GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_1) == 0))
 	{
    GPIOI->BSRRL = GPIO_Pin_11;
	}
     else 
  	   {
    GPIOI->BSRRH = GPIO_Pin_11 ;
  	 }
	   
}
   }


pleaaaase i need your suggestions and thank you in advance
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…