Input digital pins are readable as high
or low
.
Some specific pins generate external interrupts on pin changes:
int0 int1
UNO D2 D3
MEGA D21 D20
#include "intX.ceu" // `X` is a digit, e.g., `int0.ceu`
input none INTX; // `X` is a digit, e.g., `INT0`
- Occurrences:
- whenever the state of the pin changes
- Payload:
none
Gets the current state of the pin.
code/call INTX_Get (none) -> high/low do
Parameters:
none
Return:
high/low
: current state of the pin
State of output pin 13 follows the state of pin associated with INT0:
#include "out.ceu"
#include "int0.ceu" // UNO=D2, MEGA=D21
output high/low OUT_13;
var high/low v = call INT0_Get();
emit OUT_13(v);
loop do
await INT0;
v = call INT0_Get();
emit OUT_13(v);
end