adapnex::core::R_TRIG
Rising edge detector.
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 |
|---|---|---|---|
|
|
Input |
The signal to monitor for a rising edge. |
|
|
Output |
Becomes |
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(). |