Created an object for the expansion board connected to Zerynth ZM1 board at the
position number, counting from left to right. Valid positions are 1 to 4.
selectors is a tuple composed as in the following:
- Port Expansion (PE) address.
- Interrupt pin.
EXP object is created, the expansion board can be used from the application by using the
Both values are integers from 0 to 3.
Switch the specified relay COM to the NO (Normally Open).
relis the RELAY to open.
Switch the specified relay COM to the NC (Normally Closed).
relis the RELAY to close.
Get the status of the specified RELAY.
outis the RELAY to check.
Return 1 if the RELAY is on. 0 otherwise.
Print the IO expansion summary on the console.
from bsp import board from expansions import relay board.init() sel = (1,) rel_e = board.next_expansion(relay,sel) rel_e.relay_off(rel_e.OUT1) rel_e.relay_off(rel_e.OUT2) rel_e.relay_off(rel_e.OUT3) rel_e.relay_on(rel_e.OUT4) rel_e.relay_on(rel_e.OUT5) rel_e.relay_on(rel_e.OUT6)