# mPy - connect input to output
# by Anthony Vogelaar, Perth Scotland
# rev 0.10  2024-10-24  initial release

from	machine_sim	import	Pin
import	time
from	ve_rw2050	import	portA, portB

# =========================== Hardware set-up =============================

RED   = 0
GREEN = 1

pin_out = portA[0]
pin_inp = portB[0]
out		= Pin(pin_out, Pin.OUT, value=RED)
inp     = Pin(pin_inp, Pin.IN, Pin.PULL_UP)

# ============================== main ====================================

class Main:

    # instantiate required objects an start main loop
    def __init__(self):
        self.task()
        

    # main loop
    def task(self):
        while True:
            for _ in range(10):
                level = inp.value()		# do @ 100 mSec
                out.value(level)
                Pin.qtExe()				# background task - GPIO simulator
                time.sleep(0.1)
            print('*', end='')			# do @ 1 sec
 
 
Main()

# ================================ end ================================
