2024-01-11 03:35 AM
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
Solved! Go to Solution.
2024-01-11 06:05 AM
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.
2024-01-11 05:23 AM
What board?
Is there a UART using these pins? Provide a schematic.
2024-01-11 06:05 AM
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.