from machine import PWM,Pin,ADC,I2C,SoftI2C
from pico_i2c_lcd import I2cLcd
import time



i2c =SoftI2C(sda=Pin(18),scl=Pin(17),freq=40000)

lcd_addr = i2c.scan()[0]
lcd =I2cLcd(i2c,lcd_addr,4,20)


xAxis = machine.ADC(26)
yAxis = ADC(Pin(27))
button = Pin(16,Pin.IN, Pin.PULL_UP)


while True:
    
    xval = xaxis.read_u16()
    yval = yaxis.read_u16()

    
    xpos = ((xval / 65535) * 200) - 100
    ypos = ((yval / 65535) * 200) - 100

   
    print("X Position:", -xpos, " Y Position:", ypos)
    time.sleep(2)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT