from machine import Pin
from time import sleep
from joystick import joystick
j=joystick(34, 35, 15)
ledA = Pin(4, Pin.OUT)
ledR = Pin(14, Pin.OUT)
while True:
j.update()
print(j.x)
print(j.y)
print(j.button)
sleep(1)
if j.y == 1:
ledA.value(1)
sleep(0)
else:
ledA.value(0)
sleep(1)
if j.x == 1:
ledR.value(1)
sleep(0)
else:
ledR.value(0)
sleep(1)