Skip to content

EDGE_RISING behaving like EDGE_BOTH #22

@ephestione

Description

@ephestione

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions