DIO loopback port

 1'''
 2DIO - DIO_loopback_pins.py.
 3
 4This example shows how to use DIO loopback with port
 5It involves using DO pins to send signals and DI pins to receive signals on a single device, commonly known as "loopback".
 6It performs the operation of writing to a DO pin and reading from a DI pin.
 7
 8For other examples please check:
 9    https://github.com/WPC-Systems-Ltd/WPC_Stand-alone_Python_release/tree/main/examples
10
11Copyright (c) 2024 WPC Systems Ltd.
12All rights reserved.
13'''
14
15## WPC
16import pywpc
17
18## Parameters setting
19pin_state = [1, 0, 1, 0, 1, 0, 1, 0]
20
21## Write port to high or low
22status = pywpc.DO_writeAllChannels(pin_state)
23print("DO_writeAllChannels status: ", status)
24
25## Read DI port state
26state_list = pywpc.DI_readAllChannels()
27print("DI_readAllChannels: ", state_list)