Giter VIP home page Giter VIP logo

freejoy's Introduction

FreeJoy

FreeJoy is a widely configurable game device controller based on the cheap STM32F103C8 microcontroller board. It allows you to create your own HOTAS, pedals, steering wheel device, etc, or customize a purchased one.

Getting started

See our wiki for instructions on how to flash firmware to your board and how to configure the device for your application.

Features

FreeJoy supports the following external periphery:

  • 8 analog inputs (12 bit output resolution)
  • axis to buttons function (up to 12 buttons per axis)
  • buttons/encoders to axis functions
  • 128 digital inputs (buttons, toggle switches, hat povs, encoders)
  • 5 shift modifiers
  • 4 hat povs
  • 16 incremental encoders
  • shift registers 74HC165 and CD4021
  • digital sensors TLE5010/5011, TLE5012B, AS5048A, AS5600, MLX90393 (SPI interface only)
  • external ADCs ADS1115 and MCP3201/02/04/08
  • 4 PWM channels for lighting
  • 24 LEDs (single or matrix) bindable to buttons' states
  • device name and other USB settings

Axes

FreeJoy supports up to 8 analog inputs at pins A0-A7 and digital sensors as axis sources. Every axis has its own settings, including:

  • Source/destination (X, Y, Z, Rx, Ry, Rz, Slider1, Slider2)
  • Output enabling/disabling
  • Resolution
  • Calibration (manual or auto)
  • Smoothing (7 levels of filtering)
  • Inversion
  • Deadband (dynamic or center)
  • Axis offset option (magnet offset)
  • Curve shaping
  • Functions for combined axes
  • Buttons from axes
  • Axes from buttons/encoders

Buttons

FreeJoy allows you to connect up to 128 digital inputs as single inputs (tied to VCC or GND), button matrices, shift register inputs and axis-to-buttons inputs. Inputs can be configured as:

  • Regular push button
  • Inverted push button
  • Toggle switch ON/OFF
  • Toggle switch ON
  • Toggle switch OFF
  • POV hat button
  • Incremental encoder input
  • Radio buttons
  • Sequential buttons
  • 5 shifts

FreeJoy Configurator utility

FreeJoy configuration is possible using an external utility.

freejoy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freejoy's Issues

LED function Blink (Feature Request)

This is a request in case it is possible to add in future versions.

BLINK in LED functions. When the switch is activated, the LED is blinking.

28c51e86e41f052fa0b5db2aaf29c512

Analog input

Hi
Buttons are working but I couldn't get analog inputs work
even without connecting anything to A0 - A7, the input values are changing (some kind of noise)
I see values using windows controller configuration and a few joystick/gamepad programs
All analog inputs are moving even without a connection
is there anything I'm doing wrong?

Support for multiple HID devices for one STM32 module

Maybe you won't find this as an issue but that would be great to have more than one Joystick virtual device after connecting the module. That would simplify configuration in many systems, especially MAME. Encoder pulses could be mapped to virtual mouse movement as well.

Teamspeak does not recognize Buttons

hello,
i am using Freejoy for a buttonplate . i try to assign a button to push to talk .

windows gamecontroller sees every button. all games i have tested too,
when i try to assign a button in teamspeak for push to talk something strange happens:
teamspeak accepts only to buttons of 14 working and both buttons are recognized as button 2 of gamecontroller.
i tried to change the logic button -> physical button. windows recognized the change. teamspeak only recognizes the two buttons before as button 2.

i use version 1.4.1.b5

Encoder Type

Encoders work 6x but I can't select encoder type.

imagen

Feature request: Fast encoder as mouse

I just discovered FreeJoy, really amazing.

I was planning to build my own USB interface for Retropie/Mame. A single Blue Pill with USB HID implementing both a joystick and optical rotary encoder. The rotary encoder to be used for old arcade games like Tempest and Arkanoid.

Usually all optical encoders for arcade emulators work as a mouse, sending an x-axis (or y-axis) increment for every encoder step. I see that FreeJoy sends button events instead, because it's been implemented as a joystick profile.

Do you think you will ever have any interest in adding a USB mouse HID profile and using encoders as a mouse? It would also work as trackball (but only if there is a way to implement another fast encoder for the other axis)

logitech G25/27 shifter

Hello. Thanks for great project.
Q: It is possible to config FreeJoy for support logitech shifter? some manual how do this?
I would like to use a shifter and handbrake on the same bluepill if possible.
thanks!

DPad configuration

Hi. Very impressed from this project and it's configuration tool.

What I don't seem to find is a option to use two digital inputs for one axis.

(What I'm trying to do is to usbify my old Competition Pro 2 axis 2 buttons (or any old arcade joystick for that matter.) https://upload.wikimedia.org/wikipedia/commons/thumb/9/96/CompetitionPro_2nd_Series_Inside.jpg/1600px-CompetitionPro_2nd_Series_Inside.jpg)

I did find the 4 pov/hat controls but they end up being analog axis 8+ and I'd like mine to be axis 0/1.

MLX90393 16bit AD support

I just want to know if its possible to add this hall sensor that uses i2c communication to create joystick device using FreeJoy with STM32? There are i2c files in the drives folder (stm32f1xx_hal_i2s.h) and (stm32f1xx_hal_i2s.c) but I don't know how to use them. I have a code to run the mlx90393 with wire.h library using Arduino Leonardo and Arduino Joystick Library by MHeironimus to make the joystick but I want to use the power of STM32 with better clock speed.
Thanks

Missing Shift Register functionality

On main page there is screenshot that has "Shift registers" tab. But when I launched config utility - there is no such tab :( Are there any plans/intentions to add such functionality?

Linux guide

I would like to contribute a guide for linux users (if thats ok for you).
You can preview it here: https://github.com/piccaso/FreeJoy/wiki/Linux-guide
But since this is part of the wiki I can't send you a web based pull request (or at least I don't know how).
So I think the only thing I can do here ist to request that you pull from https://github.com/piccaso/FreeJoy.wiki.git :)

STM Cube IDE 1.2.0 does not run source code

Hi everyone,

STM Cube IDE 1.2.0 does not run the source code. There are several errors
Could someone help me how I can make modifications by the source code, should I use Cube IDE or CubeMX?
On the stm.com it is difficult to find old versions of CubeMX. Thanks.

Black pill?

Hi I wanted to know if you plan on making this compatible with the STM32 black pill?

Improve latency

I work on the MiSTerFPGA project. We have a testing suite used to measure input latency using an FPGA in the loop.

FreeJoy is something I'm very intersted in using in some upcoming projects, but it would be awesome to find a way to decrease the input latency.

The best controllers have 0-5ms of latency, where FreeJoy currently has ~60ms:
Average: 60.1666 ms Max: 63.804 ms Min: 56.408 ms Std Dev: 1.591 ms
I set up all buttons to be BTN_GND, and ran the test with more than 2000 samples.

Let me know if I can be of any assistance!

Encoders in button matrix

Can you please implement support for rotary encoders connected in button matrix? It will be very useful.

Support for 74HC595 shift register.

It seems that the 74HC165 is now discontinued and it's becoming hard to find it (I ordered a few and it will take 2 months to arrive in Canada). Is there any plans to support 74HC595?

Multiple Encoder Connection

I am connecting several encoder in chain with 1N4148 diodes but I can't get it to work. The encoders do nothing when I connect the diodes according to the attached scheme, without diodes it works but causing multiple unwanted pulses between the two encoders.

PEC11R Encoders:
http://www.farnell.com/datasheets/2360546.pdf?_ga=2.13033214.817435842.1595327489-134403827.1586878496

Freejoy Config:
B12,B13 as Column Button
B14,B15 Column Row

Can FreeJoy work with this setup?

imagen

imagen

imagen

Toggle switch connections

Hi! I am finishing a PCB to support a bluepill with Freejoy and I am a little lost with the configurator options for toggle switches:

I understand I have to configure them as buttons and then select toggle but

  • For a 3 pos toggle (think Flaps: Full-Half-Auto) do I need an ON-ON-ON? Or can I do with a ON-OFF-ON? What would be the diff in configuration? I was thinking to use on-off-on mapping only Full and Auto...would that work?

I've browsed the wiki but could not find this info. I think some examples of connection+their configs would be helpful (I can gladly help creating them once I get it clear myself)

POV diagonal problem

configuring 4 buttons as pov left/right/down/up I cannot press them diagonally. The second button clears the value of the first one.

Analog Axes to Buttons

Hi,

I can't get axes to buttons conversion to work. I'm trying with a 12 position rotary switch with a voltage divider but only 8 positions work. Analog raw read at positions 1 to 4 remains at 32.767, 5 to 12 between 28.0xx to -24.0xx

Is this setting correct in Freejoy Configurator?

Thanks!

1-4 Positions

5 Position
imagen

12 Position
imagen

Axes to buttons
imagen

IS THERE ANYTING WRONG WITH ENCODER?

When I choose physical NO. as encoder A and encoderB,all of the physical icons begine to light green quickly。 And it cannot write to the device when any physical NO. was setted as encoder mode. The physical NO. mode automatically changes to normal button mode when reads config from device after Fjoy is restarted。

encoder: EC11
with 74hc165D,5v pull up。

How do I build from source

I would like to experiment with the code myself, but I am not sure where to start. I have experience of Arduino, PlatoformIO and some Rust experience on STM32F1 and F4, but I need a little direction on where to start with this project.
What IDE and compiler do you use, and how is it set up?
I notice a makefile, MDK-ARM folder, but also armgcc folder.

Do I need the ARM MDK software? If so which version? Can I configure VS Code and gcc?

Any help would be greatly appreciated.

Toolchain used?

Hi guys,

I'd been playing with the sources, to become familiar with and potentially contribute something in the future. Problem is I am not that familiar with STM32 and last time I used them it was with a company-paid Keil IDE.

So, I downloaded and installed the new STM32CubeIDE, but it wants to convert the project to a different format, and tells something about it being an MX format used. My question is: which toolchain (IDE,compiler...) are you using? I assume using the same one would be the most straightforward approach, and I have no preferences, honestly.

When I convert the project to the STM32CubeIDE as a STM32 project, I can't build it, and cannot even modify the project properties, like if I'd like to compile for a different uC of the same family, I cannot choose the device. If I convert it to MX project, then most of the source is replaced by auto generated code, and even the main.c is completely different (placeholder like)...

Could you please help me here?

Thanks!!

Shift Register CLK to any PIN, not only SPI_SCK B3

Greetings! Is it possible to make programmable CLK assignable for any pin for SHIFT registers? Same way as it is done for ShiftReg_DATA or ShiftReg_LATCH. In latest release I see that it is only possible to use pin B3

Analogue Axis to Buttons - Leo Bodnar 12 position switch

Hi,
I'm getting odd behaviour when using the Axis to Buttons feature with a Leo Bodnar 3-pin 12 position switch.
Basically, I'm assigning switch positions 1-5 as "Shift" buttons so that 2 rotary encoders can serve multiple functions.
It works 70% of the time, however, when turning the rotary (e.g. logitech button 14/15) it'll report button 14 pressed, unpressed, pressed unpressed, then out of no-where it'll act as if the rotary switch has been changed for a split second & engage a different shift-version of the encoder momentarily.

Reviewing the axis RAW output, it appears to stutter by about 15 points, every second or so, and about 100 points when other buttons/rotaries are engaged.

Would it be possible to provide a wider band for each "position" when using the Axis to Buttons feature? I'm only speculating that this is the issue, so I could be wrong but would appreciate your support.

Thanks

Combined axes functions

Is it possible to combine two axes that work cooperatively ? I want to combine 2 analog inputs in one axis like old OSH combined axis function. I am not able to make it work.

Thanks!

From OSH :

"As you can see, there is also «Combined axis» function. It means you can combine 2 analog inputs in one axis. The function is mainly intended for rims with 2 clutch paddles. There are 2 possible modes:

  • cooperative work — in this mode results from both analog inputs are summarized. You can choose weight of each input by slider.
  • each on his own — each analog input works independently but for one axis. For example you can short calibrate an one input (paddle) for fast gear changes and an other calibrate as normal axis — for starting.

imagen

Shift register vs. button matrix

I am preparing a PCB that will be using Freejoy... I have a big number of buttons to be scanned, plus a couple rotary encoders and the full 8 analog axis, so I am concerned about the performance...

So, what would be a better idea for the buttons: 4 SPI 8-bit shift registers? Or as 6x5 button matrix with diodes?

Best regards

Dynamic HID Config

Hi,

I am running into some trouble configuring the buttons.

HID Dynamic Enabled: Some buttons do not work.
All the buttons light up green in Freejoy physical buttons section, but only some show keystrokes in the Freejoy button log.

HID Dynamic Disabled: All buttons work.
All buttons work, light green and appear in the button log, but only 32 appear in Windows device settings.

imagen
imagen
imagen

Support for multiple AS5600 Hall sensors

Just a suggestion.
As you will probably agree, the single-address design of AS5600 Hall sensors was not the greatest idea by its manufacturer, but that's something we have to live with.
Since it's almost a shame to have the support for that component available in FreeJoy, but with very limited utility given that constraint, do you think it would be possible to add support for an I2C multiplexer like the TCA9548? This would allow to have up to 8 sensors, which would be enough for a complete set of axes.
(Don't know but it might become handy for some other of the I2C peripherals too).
Thanks for your EXCELLENT job!

Update firmware from linux

Hi, congratulations for this excellent firmware project.
Is there any chance we can get the configuration and updater app work in a linux enviroment like debian/ubuntu?

Port expanders and RGB LEDs support

Hello,
I am wondering if you considered supporting MCP23x17 family port expanders (https://www.microchip.com/wwwproducts/en/MCP23017)? They have 16 IO ports per chip, easy to configure, work in wide voltage ranges and allow to hook up both buttons (inputs) and LEDs (outputs).
Also, it would be cool if ws2812 type addressable leds were supported.
Both suggestions would free up lots of pins I believe.

FreeJoy is workin but DCS dosen't recognize a button press.

The FreeJoy Board is recognized by Win10, all Buttons (via shift registers) and axes do work in the configuration app and in the system settings. When I try to bind a button in DCS or in IL2 it dosen't recognize a button press. Although it is visible in both. After starting up DCS with open System setting dialog for gamecontroller it showes no pressed button in there either.
My board does have the 10KOhm as R10 Resistor soldered.
Thanks for your outstanding work.

help

Dear Sir
Can STM32F103ZET6 be used in this program?

Request: Enumerate as a keyboard using PWM for analog inputs

Years back, I wrote a GlovePIE script to convert analog inputs from my steering wheel into PWM signals that emulated madly hammering on keyboard keys. Surprisingly, the PWM keyboard mode was absolutely indistinguishable from native steering wheel mode in the games I tried and even worked flawlessly in things like Flash games. Is that doable with this library? It would open up a LOT of options.

USB HIDName is incorrect

Hi,

Retrieved HID name is not correct in the PC app.

image

The name appears in the APP as 'r during stacking' which is obviously a partial string from somewhere random in memory

image

Additionally I cannot see to save a config file to the STM32, I tried creating a debug build to get more information for you, but unfortunately the debug build will not fit in the microcontrollers memory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.