Emits a pulse on a rising edge, i.e. when false changes to true. Does not pulse on program start even if initial input value is true.
pulse-on-true
@/pulse-on-true
Emits a pulse on a rising edge, i.e. when false changes to true. Does not pulse on program start even if initial input value is true.
node {
bool state = false;
void evaluate(Context ctx) {
auto newValue = getValue<input_IN>(ctx);
if (!isSettingUp() && newValue == true && state == false)
emitValue<output_OUT>(ctx, 1);
state = newValue;
}
}
IN | OUT |
true | no-pulse | // do not pulse even if initial state is true |
false | no-pulse |
true | pulse |
true | no-pulse |
false | no-pulse |
true | pulse |