adapnex::core::F_TRIG

Falling edge detector.

Synopsis

Declared in <adapnex/core/trigger.h>

class F_TRIG;

Description

The output Q becomes true for exactly one execution cycle when the input CLK transitions from true to false. In all other cases (steady state or rising edge), Q is false.

Parameter Type Direction Description

CLK

bool

Input

The signal to monitor for a falling edge.

Q

bool

Output

Becomes true for one cycle upon falling edge detection.

Common Use Case

Detecting when a machine has stopped or when an object has cleared a sensor.

Example: Automatic Feeder

class FeederTask : public Task {
public:
    bool exit_sensor = false;
    bool load_next = false;

private:
    F_TRIG exit_detector;

    void Update() override {
        // Check if the part has just left the sensor (true -> false).
        exit_detector(exit_sensor, load_next);
    }
};

Triggers maintain state across cycles and must be instantiated as member variables of a task rather than locally within Update().

Member Functions

Name

Description

operator()

Function call operators

Data Members

Name

Description

CLK

Input signal to detect falling edges on.

Q

Output that is true for one invocation when the input CLK changes from true to false.

Created with MrDocs