Back to Index
Definition: ain(idx) — Allowed: numeric expression index; Not allowed: string index.
ain(idx)
Reads an analog input channel (1-based index in scripts). Returns an integer provided by the host.
pressure = ain(1); publish("plc/pressure", pressure);