jedynakiewicz
Senior Member
May I suggest a new command; "EDGE". This would be similar to INPUT but would detect only a rising pulse edge or a falling pulse edge as required. In other words, only a specific directional change in the state of a pin, not the actual state. It would need qualifiers to detect the rising edge or falling edge; perhaps also a time-out period. Most usefully, it could halt at that program point and wait for the required change of state in the input pin. The value of it would be that once the pin had gone either high or low its state would ignored until the specific change occurred again.
I thought of this possible command when trying to work out how to use the one-second pulse generated by the AXE033 module - I wanted a simple way to count up the pulses and then run a routine. Detection of the rising edge only would achieve this nicely and avoid the need for a program loop that toggles the direction of pulse detection.
An alternative command name could be "CHANGE" with either CHANGEHIGH or CHANGELOW to detect the rising or falling pulse edge.
I thought of this possible command when trying to work out how to use the one-second pulse generated by the AXE033 module - I wanted a simple way to count up the pulses and then run a routine. Detection of the rising edge only would achieve this nicely and avoid the need for a program loop that toggles the direction of pulse detection.
An alternative command name could be "CHANGE" with either CHANGEHIGH or CHANGELOW to detect the rising or falling pulse edge.