RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Retroarch help with controller

    Scheduled Pinned Locked Moved Help and Support
    2 Posts 1 Posters 1.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pierpa86
      last edited by pierpa86

      Hi at all, I can not get out of this problem, I'm trying to use a joystick with 2 axes seen from linux (retropie) as /dev/input/js0,i can manualy configure it on mame but retroark keeps telling me no joypad Detected in autodect screen, i try to use js0 only for directional movements and keyboard for button

      thanks in advanced for any support.

      sudo jstest /dev/input/js0
      
               Driver version is 2.1.0.
               Joystick (python-uinput) has 2 axes (X, Y)
               and 0 buttons ().
               Testing ... (interrupt to exit)
               Axes:  0:  5170  1:  7281
      

      this is the driver in python

          #!/usr/bin/python
      
               import spidev
               import time
               import os
               import uinput
      
          # Open SPI bus
                  spi = spidev.SpiDev()
                  spi.open(0,0)
      
         # Function to read SPI data from MCP3008 chip
         # Channel must be an integer 0-7
                  def ReadChannel(channel):
                  adc = spi.xfer2([1,(8+channel)<<4,0])
                  data = ((adc[1]&3) << 8) + adc[2]
                  return data
      
               device =uinput.event([
                    uinput.ABS_X+(0,900,0,0),
                    uinput.ABS_Y+(0,900,0,0),
                     ])
      
              joy_x=1
              joy_y=2
      
        while True:
      
      joy_x_value=ReadChannel(joy_x)
      device.emit(uinput.ABS_X,joy_x_value,syn=False)
      
      joy_y_value=ReadChannel(joy_y)
      device.emit(uinput.ABS_Y,joy_y_value)    
      
      time.sleep(0.020)
      
      P 1 Reply Last reply Reply Quote 0
      • P
        pierpa86 @pierpa86
        last edited by

        @pierpa86

        solved... emulation station cant detect joypad with no buttons, you need to use joypad with at least 1 button for detect.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post

        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.