adapnex::core::R_TRIG

Rising edge detector.

Synopsis

Declared in <adapnex/core/trigger.h>

class R_TRIG;

Description

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

Parameter Type Direction Description

CLK

bool

Input

The signal to monitor for a rising edge.

Q

bool

Output

Becomes true for one cycle upon rising edge detection.

Common Use Case

Starting a process via a push‐button or counting items on a conveyor.

Example: Item Counter

class CounterTask : public Task {
public:
    bool sensor_input = false;
    int item_count = 0;

private:
    R_TRIG count_trigger;

    void Update() override {
        count_trigger(sensor_input);
        if (count_trigger.Q) {
            item_count++;
        }
    }
};

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 rising edges on.

Q

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

Created with MrDocs