Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Custom hardware, STM32 with FreeJoy as joystick, can't bind Rx axis

Discussion in 'Input System' started by JDMulti, Jul 7, 2020.

  1. JDMulti


    Jan 4, 2012
    For the people experimenting with hardware and Unity. I do this quite often but now I hit a hard brick wall. :)

    I'm trying to use a STM32 to emulate a joystick named "FreeJoy" which has a magnetic sensor connect and using the new Input System

    Using magnet I can emulate a joystick, rotating the magnet shows a value between -1 and 1. This solution works just fine when using any kind of game controller preview software. I can see the value going up and down as I rotate the magnet over the sensor and having the FreeJoy update the value within the software.

    However where the issue comes is that I try to get the same value output by the FreeJoy to be used within Unity.

    I can see the FreeJoy joystick just fine


    I can see the Rotation Axis value update whenever I double click the FreeJoy in the above image


    However when I want to bind anything to 'Rx' using the 'Input Actions' menu from the Input System, I don't see any axis at all


    Now I have 2 questions:

    1.) Why can't I bind the rotation axis from the binding menu?
    2.) While double click the FreeJoy and see the Rx value, I noticed that there is a deadzone between max value and min value where the value switch is happening. Example: from 0.99 to 1 but then when I rotate a little it stays 1 for a while and then turns into -0.01. This is however not happening in any game controller preview software else then Unity. I can 100% guarantee that the data from the sensor isn't behaving like that but that Unity is somehow adding a deadzone under the hood.

    Does someone know how I can get the FreeJoy work properly?
    At the moment I have no clue how to fix it as the sensor works just fine but Unity seems not to work that well with the sensor. Only solution I have now it remove the FreeJoy and send data over Serial and get the magnet sensor data that way.