bool32.rising increment trigger
bool32.rising decrement trigger
bool32.rising reset
int32 max
int32 output
bool32.pulse carry pulse
int ntrig;
int rtrig;
int dtrig;
int count;
count = 0;
ntrig = 0;
dtrig = 0;
rtrig = 0;
outlet_c = 0;
if ((((inlet_trig > 0) && (inlet_updown < 1))) && !ntrig) {
count++;
if (count >= inlet_max) {
count = 0;
outlet_c = 1;
}
ntrig = 1;
} else if (!(inlet_trig > 0))
ntrig = 0;
if ((((inlet_updown > 0) && (inlet_trig))) && !dtrig) {
count--;
if (count < 0) {
count = inlet_max - 1;
outlet_c = 1;
}
dtrig = 1;
} else if (!((inlet_updown > 0) && (inlet_trig)))
dtrig = 0;
if ((inlet_r > 0) && !rtrig) {
count = 0;
rtrig = 1;
} else if (!(inlet_r > 0))
rtrig = 0;
outlet_o = count;