Bluetooth N64 controller - How to register the analogue stick as axis coordinate

Hi all,

Please bear with me as I am new to the Arduino world..

Basically I am building an ITX PC into my old N64 console and I wanted to make a bluetooth N64 controller to both use as a remote and also to play emulated games.

I have the N64 controller already interfacing with my PC via an Arduino nano and USB connection based on this well written tutorial/sketch - http://www.instructables.com/id/Use-an-Arduino-with-an-N64-controller/ (I'm waiting on some resistors before I can convert the serial connection over to bluetooth).

Now, this works fine to an extent but the analogue stick is only registered by the processing framework as a keyboard key stroke, ie. up/down/left/right and the position of the stick (co-ordinate), although interpreted by the serial connection, is lost. This means the stick has no sensetivity and hence isn't much use in most N64 games where you may need to, for instance, carefully walk mario accross a narrow bridge.

I've searched the processing libraries to try and find something that would 'mimick' a game controller axis but found no such thing.

Does anyone know of a way that I can either use processing (or other language) to send windows a command that is recognised as a 'mappable' controller x/y axis or alternatively a method of programmig the arduino to register as a serial game controller ?

Any help or comments are largely appreciated !

Phil

What emulator are you using? Is there a provision for mapping an analog input to it?

Arrch: What emulator are you using? Is there a provision for mapping an analog input to it?

I am using project 64 and yes an analogue input can be mapped. However the data sent over the serial connection is as the N64 is used to seeing it - streams of 0000000000000000 0 0 - Where the first 16 bits are button presses and the last to 0s are the X and Y values of the analogue stick position as an integer between 0 and 128.

The processing sketch translates this into an HID keyboard stroke, but I would like to translate the co-ordinate so it is processed as an analogue 2 axis joystick of a gamepad to give not only sensitivity but also more 'directions' than just North, North East, East etc...

I'm sure there must be a way, I just need a genius to point me in the right direction !

I'm not familiar enough with operating system drivers, but it seems as though the Arduino is doing it's job in getting you the data, the problem lies on the computer's end with how you map the data (via Processing) to something that can be recognized as analog by the emulator. Perhap's mouse position is something that can be utilized?

Thanks for the reply Arrch, unfortunately I have tried with mouse position and been unsuccessful.

I think that perhaps the only way for me to do it is to make the Arduino appear as a HID compliant game controller.

I don't know a lot about this but I presume to do so, I will need to program all the USB headers and descriptors in order for windows to recognise it so.

I fear a lot more research is needed yet...

I haven't done anything with it yet, but it looks like I have stumbled accross exactly what I was looking for.

Once I get my bluetooth controller baterried and all set up, then I will post a build blog.

Phil

impartialise: I haven't done anything with it yet, but it looks like I have stumbled accross exactly what I was looking for.

Any website I can take a look at in the mean time? I ran into this limitation a while back and would be interested in getting it working as well.

For sure - http://www.circuitsathome.com/mcu/hid-joystick-code-sample

I meant to link to it in my original post but evidently I must have forgotten !