Custom JoyCon with Arduino nano BLE - JoysticPosition Readout and Mapping - Help

Hi there,

I'm a newbie in this topic, so before buying the right components and start developing, I need some Info about capabilities of these chips and the code itself. Maybe some Pro's can help me a little bit with this !?

My goal is to make some kind of JoyCon Bluetooth HID Controller (OneHanded Controller for moving). So I want to connect an analog Joystick and at least 7 Buttons (wish for 8-10 Buttons) + The Button of the analog Joystick. Because the NANO hast limited input support for Buttons in general I hope there is maybe a solution with the right Code, with something like double-mapping while holding a button to compensate the 8-input Trigger limitation, like with macros or something like this. Furthermore I wanna simulate an analog joystick input with WASD 4-way digital input.

Let me explain in detail with a sketch (see Attachment):

So the Goal is to read out the position (range) of the Joystick and define a (multi-) Keystroke for each Zone. For this example I wanna use it for FPS Games with the following Keys for the following Commands:

W - Move Forward
A - Strife Left
S - Move Backward
D - Strife Right
V - Sprint (run fast)
ALT - Sneak (move slowly)

So to explain the Sketch, my Idea is first to define a zero input tolerance of eg 10% to avoid zero position moving. The Second Zone 10-60% is for moving slowly, so instead of pressing the sneak Button (ALT) with direction (W, A, S, D) I want the ALT key automatically be pressed when the Stick is in that range of 10-60%. The last Zone is for ordinary WASD Input (normal speed movement). The V-Key is set for full speed running, this is set to the Joystick Button Press (pressing down the Joystick).

The other thing is to double bind a Key-Input like with a macro, for this I example I wanna explain it with FPS position layout. So my idea is by "pressing" one button (bind it with the X-Key) my avatar will go from standing position to crouching position, and by "holding" the same button (eg. for 2 seconds) it enters another keystroke (bind it with the C-Key) so my avatar lies down.

The last idea is to implement the g-sensor for additional input. So my idea is to input G or R Key while shaking the controller for Reload or Grenade Throwing for example.

The JoyCon should communicate via bluetooth as a HID keyboard wirelessly.

So my Question is, if this is even possible with one of the NANO Boards or maybe another chip !? I should know if this is even possible with these or if I should search for another one which maybe would conclude better for this !?

Thanks a lot !

Hi. I’m trying thoses kind of thing for a 4wheel car: final dream is made of a 33iot acting as a BLE remote control with 2 joysticks and an oled screen (display of actual settings/debug/unuseless movie style displays).

First made a simple code to visualize raw data (raw data are the key because your coding will interface user’s requirement with hardware capability) like:

Get the data into a dedicated value from the sensor :
Joystick_axe_X = Analogread(A0);
Joystick_axe_Y = Analogread(A1);

Display fresh data to serial monitor :

Try to manipulate the joystick White keeping an eye on value and consider as full range (and relative position of your finger) as stability.
I had bad surprises with online bought stuff : centered position was not 512 as expected (half of 1023 wich is max value for Analogread) but roundly 490. And different, and not stable for each one of the 2 joysticks. As a final hint of deception, max electric value (0 OR 1023) was reached at half the way I can run wih the finger, meaning poor resolution.

Then you could select a good way to interpret then calculate (so transmit key input).

About materials, any arduino card is able to record analog input (variable position of joystick) and digital input (on/off button).
Eventually, some say only recent card (Not 8bit like nano) can handle large amount of data from accelerator sensor like 33ble and 33iot.
So far, accel/gyro could be purchzsed in a module and connected to a nano, freeing the card from large calculations. Indeed, wireless com will have to be aquired separetely.

Good luck with your project, make your best to sharpely define your need, then how you will respond to any of it.

-> i think you may rely your project on a 33ble or iot as they embedded wireless communication and accel/gyro sensor. A large amount of button could be restrictive (or will need more component like shift register) but a usual gamepad will fit into.
-> any other requirement, involving interface and behavior with the user could be supported by code (Meaning easy improvment or correction rather than unwelding). It applies to timing, combination of button, or precise joystick combination, movement of the device itself and any combination you could imagine.