cancel
Showing results for 
Search instead for 
Did you mean: 

OR logic gates

LFerr.7
Associate II

Sorry for not explaining well, my english is not very good but what i am trying to do is a sum of two signals. I have write a simple code . I have the violet signal in PE9 and the light blue signal in PB0. I am trying to do the sum of this pins and map it on PE13(yellow color) .0693W00000Nq1EFQAZ.pngDespite iam using a boolen library using (OR || symbols) ,it is not what i expected, because it is not a real sum, in blue color you can see that it is a fake sum. What can i change ? How can i do an accurate the sum between this pins?

Thank to everyone that will answer. Respect to anyone!0693W00000Nq1DWQAZ.jpg

1 REPLY 1
Mike_ST
ST Employee

Hello,

I'm not sure what you want to achieve, but for faster operation, I would avoid HAL layer and go for something like that:

while (1)

{

   if ( ((GPIOE->IDR)&GPIO_PIN_9) || ((GPIOB->IDR)&GPIO_PIN_0) ) GPIOE->BSRR = GPIO_PIN_13;

   else GPIOE->BSRR = GPIO_PIN_13<<16;

}

I have not compiled/tried it, but you get the idea.