Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EDGE_RISING behaving like EDGE_BOTH #22

Open
ephestione opened this issue Jul 25, 2019 · 0 comments
Open

EDGE_RISING behaving like EDGE_BOTH #22

ephestione opened this issue Jul 25, 2019 · 0 comments

Comments

@ephestione
Copy link

First of all, I see no activity in this repo since a while ago, and even if I'm currently using it in a project of mine, are there any reasons that I shouldn't?

Now to the question.
First version of my code was using:
$pin[$sensore]->setEdge(InputPinInterface::EDGE_BOTH);

but then I realized I only was actually inerested to check when the input became from LOW to HIGH, so I changed it to
$pin[$sensore]->setEdge(InputPinInterface::EDGE_RISING);

What I noticed, tho, is that I kept getting the same amount of events of the first version.
It's a motion sensor which is activated, and then deactivates itself after 2-3 seconds, and even if I try and select only EDGE_RISING (activation in this case) I get an event both when sensor activates (LOW->HIGH) and when it deactivates (HIGH->LOW).

Shouldn't matter much as I can prune those event I'm not interested in, I just wonder if it wouldn't use less resources if it worked as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant