# mPy - kit FKS0001 button test
# provided by Anthony Vogelaar, Perth UK
# rev 0.10  2025-05-14  initial release

from	machine			import	Pin
import	time
from	fks_drivers_01	import	lprint

# print button level to LCD as 1 / 0
def test1():
    btn_red = Pin(33, Pin.IN)		# connect SW1 to IO33
    while True:
        lprint(btn_red())
        time.sleep(1)
    

# print button level to LCD as True / False
def test2():
    btn_red = Pin(33, Pin.IN)		# connect SW1 to IO33
    while True:
        btn = btn_red()
        btn = bool(btn)
        lprint(btn)
        time.sleep(1)


# print button level to LCD as False / True
def test3():
    btn_red = Pin(33, Pin.IN)		# connect SW1 to IO33
    while True:
        lprint(not bool(btn_red()))
        time.sleep(1)


# print button level to LCD as False / True and set RED led
def test4():
    btn_red = Pin(33, Pin.IN)		# connect SW1 to IO33
    led_red = Pin(32, Pin.OUT)
    while True:
        btn = not bool(btn_red())
        lprint(btn)
        led_red(btn)
        time.sleep_ms(100)

test1()

# ======================== End =======================
