Page 1 of 1

question about XY Joystick Module + ESP32

Posted: Thu Jul 08, 2021 7:54 am
by y1ngkhun
Hi I have some question about XY Joystick Module + ESP32

Code: Select all

from machine import Pin, ADC

x = ADC(Pin(36))
y = ADC(Pin(39))
x.atten(machine.ADC.ATTN_11DB)
y.atten(machine.ADC.ATTN_11DB)

while True:
print(x.read(), y.read())
time.sleep(1)
this is my action
not move 2691 2726
move left 0 2722
move up 2721 0
move right 4095 4095
move down 4095 4095

I got wrong value when move right and move down do I miss something ?

Thank You

Re: question about XY Joystick Module + ESP32

Posted: Thu Jul 08, 2021 7:58 am
by jimmo
y1ngkhun wrote:
Thu Jul 08, 2021 7:54 am
I got wrong value when move right and move down do I miss something ?
How have you wired up the joystick? Can you test it directly with a multimeter (i.e. in resistance measurement mode).

Re: question about XY Joystick Module + ESP32

Posted: Thu Jul 08, 2021 8:09 am
by y1ngkhun
jimmo wrote:
Thu Jul 08, 2021 7:58 am
y1ngkhun wrote:
Thu Jul 08, 2021 7:54 am
I got wrong value when move right and move down do I miss something ?
How have you wired up the joystick? Can you test it directly with a multimeter (i.e. in resistance measurement mode).
I have connected joystick like this
Image

idk how to resistance measurement mode Im really new here sorry

Re: question about XY Joystick Module + ESP32

Posted: Thu Jul 08, 2021 9:18 am
by y1ngkhun
jimmo wrote:
Thu Jul 08, 2021 7:58 am
y1ngkhun wrote:
Thu Jul 08, 2021 7:54 am
I got wrong value when move right and move down do I miss something ?
How have you wired up the joystick? Can you test it directly with a multimeter (i.e. in resistance measurement mode).
ohhh.. I just make its work change vin(5v) to 3v :oops:

Thank You for reply :D