STM32 NUCLEO GPIO IDR BIT MASK PROBLEM
Hello,
I'm using STM32 NUCLEO board.
In my application, I want to read GPIO PORT A input register (IDR) & (pins setup as inputs).
With that variable, I want to do something, if specific pins are HIGH, execute the if cycle.
As an example, I want to execute my logic if PIN 0 and PIN1 both of them HIGH, All I do in while cycle is:
read=GPIOA->IDR;
if(read &0b0000000000000011)
{
Do something if PIN 0 and PIN1 are HIGH
}
else
{
Do something if the statement above was FALSE.
}
In debugger mode I can see the status of the pins, and if I changing them between high/low the register see that, but my if cycle doesn't seem to work. Sometimes it executes if, sometimes executes else statement. Is it something wrong with the bitmask?
