2022-05-16 03:24 AM
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) .Despite 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!
2022-05-16 03:49 AM
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.