GuyCarver / MicroPython

All of my MicroPython stuff
143 stars 62 forks source link

MicroPython Joystick driver issue #1

Open Sunrise17 opened 6 years ago

Sunrise17 commented 6 years ago

Dear @GuyCarver , i have tried joystick.py in my micropython (v1.9.4-7-gaeaace07 on 2018-05-13) installed ESP32 board. I have found some inconsistencies when i start getting values. You can see in attached photos below; I will be glad if you let me know about the issue, Thanks...

This is my main code;

from machine import Pin
import Joystick
import time

x_pin = 36 #ADC PIN - (VP ON BOARD)
y_pin = 39 #ADC PIN - (VN ON BOARD)
button_pin = 5 #DIGITAL PIN FOR BUTTON

j = Joystick.Joystick(x_pin, y_pin, button_pin)

while True:
    j.update()
    print("x:", j.x, "button:", j.button, "y:", j.y)

    time.sleep(0.1)

Center center

Right right

Left left

Up up

Down down