cancel
Showing results for 
Search instead for 
Did you mean: 

GPO is not working properly

yugi
Associate

Hi Guys I'm facing one problem in GPO side .i have try to read the input pin PA_3 and PA_2 that time i'm facing one issue .

what i'm do try to read the switch using PA_3 and PA_2 Software side i have write pull down 
when i'm press the switch one PA_3 executing that loop same pa_2 but problem i have press the PA_3 switch is working Pa_2 loop and i press the pa_2 switch but is working pa_3 loop sometime is work normally 

 

this is my code so please help

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You have a blocking 10sec delay within each loop. It won't look at PA2 until PA3 is complete with its 10 second loop.

You need better program logic here. Use a state machine or a callback to advance whatever it is you want to do. Increment a counter and when it reaches certain values, toggle pins at the appropriate time.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2

What board?

Is there a UART using these pins? Provide a schematic. 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
TDK
Guru

You have a blocking 10sec delay within each loop. It won't look at PA2 until PA3 is complete with its 10 second loop.

You need better program logic here. Use a state machine or a callback to advance whatever it is you want to do. Increment a counter and when it reaches certain values, toggle pins at the appropriate time.

If you feel a post has answered your question, please click "Accept as Solution".