node {
Number sample = NAN;
void evaluate(Context ctx) {
auto newValue = getValue<input_IN>(ctx);
if (!isSettingUp() && newValue != sample)
emitValue<output_OUT>(ctx, 1);
sample = newValue;
}
}
IN | OUT |
0 | no-pulse |
12 | pulse |
23 | pulse |
23 | no-pulse |
45 | pulse |
0 | pulse |
0 | no-pulse |