Code Monkey home page Code Monkey logo

unojoy's Introduction

UnoJoy

UnoJoy! allows you to easily turn an Arduino Uno (or Mega or Leonardo) into a PS3-compatible USB game controller

Getting Started

Hi there!  Welcome to using UnoJoy!

UnoJoy lets you use a plain, unmodified Arduino Uno
to create native USB joysticks.  It is a three-part system:

Drivers - Needed to re-flash the Arduino's USB communication chip
Software - The UnoJoy library for Arduino
Firmware - Code to load onto Arduino's USB communication chip

In order to make UnoJoy work, you'll need to take care of
all three parts.  We're here to make that process as easy as
possible.


Drivers
=======

In the UnoJoy directory, there are installer files for the drivers
you'll need for the DFU bootloader.  Choose the correct one for your OS:
WindowsUnoJoyDriverInstaller.exe
LionUnoJoyDrivers.pkg
SnowLeopardUnoJoyDrivers.pkg

On Windows, you'll also need to download and install Atmel's FLIP tool:
https://www.microchip.com/developmenttools/ProductDetails/flip

On Linux you'll need to install dfu-programmer. you can get it by typing to your terminal:
sudo apt-get install dfu-programmer
or
sudo aptitude install dfu-programmer 
depending on your distribution.
You can also build it from source: https://github.com/dfu-programmer/dfu-programmer
You also have to make the flashing script runnable by typing:
chmod +x TurnIntoAJoystick.sh
into your terminal when in UnoJoy directory.


Software
========

To get started, first, go to the UnoJoyArduinoSample
folder. Open up UnoJoyArduinoSample and upload that code
to your Arduino.

Next, test to make sure that it's working, we have a Processing
sketch to test your controller without having to cycle through
the process of going reflashing the firmware back and forth.
Go to https://processing.org/ to download and install Processing.
Then you can run the UnoJoyProcessingVisualizer sketch.

*Note* You'll need to install the ControlP5 library in order
for the UnoJoyProcessingVisualizer to work. To install that,
in Processing, go to Sketch -> Import Library -> Add Library...
search for ControlP5, install it, then possibly restart Processing.

*Second Note* The compiled stand-alone processing applications seem
to have stopped working, and with Java being a pain, they're not currently
being supported. 

You should see a representation of the controller, and if you
ground any of the pins between 2 and 12, you should see
buttons on the controller light up.  Now, we move onto the hardware!


Hardware
========

Now that we have the proper code on the Arduino, we need
to reprogram the communications chip on the Arduino.
In order to do this, you need to first put the Arduino
into 'Arduino UNO DFU' mode. The official documentation
for this is here

http://arduino.cc/en/Hacking/DFUProgramming8U2

----HOW TO PUT YOUR ARDUINO INTO DFU MODE----
You do that by shorting two of the pins on the block of 6 pins between
the USB connector.  Using a piece of wire or other small metal object,
connect the 2 pins closes to the USB connector together.
(the ones that turn from o to | in the diagram)

					  ---->
		o o o           |        | o o 
----|   o o o           |----|   | o o
	|                   |    |     
USB |                   |USB |      
	|                   |    |   
----|                   |----|
						|
It should disconnect (be-dun.) and reconnect (buh-din!) 
and now show up to your system as 'Arduino UNO DFU'.
In OSX, you will get no feedback from your computer, but
the lights on the Arduino will stop flashing.


ONCE YOU ARE IN DFU MODE
========================

Once the Arduino is in DFU mode, to update the firmware, simply click:

Windows: TurnIntoAJoystick.bat
		 
OSX:     TurnIntoAJoystick.command

Linux:   ./TurnIntoAJoystic.sh

IMPORTANT: Once you update the firmware, you'll need to 
unplug and plug the Arduino back in for it to show up with
the new firmware - it'll just hang out in DFU mode until you do.

When you plug the Arduino in again now, it will show up to your
computer as an 'UnoJoy Joystick'.  You can check this by doing
the steps in the next section.

HOW TO CHECK WHICH MODE YOU ARE IN
==================================

On Windows 7, you can check it out by going to
	Start->Devices and Printers
	and you should see it there under 'Unspecified'
	In Arduino mode, it will appear as 'Arduino UNO (COM 23)'
	In DFU mode, it will appear as 'Arduino UNO DFU'
	In UnoJoy mode, it will appear at the top as 'UnoJoy Joystick'

On OSX, you should see it:
	Snow Leopard: Apple->About This Mac->More Info...->USB
	Lion: Apple->About This Mac->More Info...->System Report->USB
	You may need to refresh (command-R) to see it update.
	In Arduino mode, it will appear as 'Arduino UNO'
	In DFU mode, it will appear as 'Arduino UNO DFU'
	In UnoJoy mode, it will appear at the top as 'UnoJoy Joystick'

On Linux, you can type lsusb to your terminal.
	In response you'll get list of all connected usb devices.
	From there you should find:
	In Arduino mode, you should see  a device named Arduino Uno etc.
	In DFU mode, you should see  a device named Atmel corp. etc.
	In UnoJoy mode, you should see a device named Cygnal Integrated Products etc.
	**Update**
	As of 2021, there has been success using the [jstest-gtk](https://manpages.ubuntu.com/manpages/bionic/man1/jstest-gtk.1.html)
	tool to test the joystick once it has been turned into a joystick

Using the Deployment Collators

There are a couple of programs for creating a quick release zip file.
The OSX one may or may not work; I haven't had a Mac in years so I haven't tested it.
To use the Windows one, you'll need to install 7zip (https://www.7-zip.org/),
then add it to your system or user path (search for Environment Variables, then edit
the Path variable and add the 7zip folder). Then you should just be able to use
Windows Deployment Collator.bat.

Steering Wheel Update, courtesy of Mustavfa Cem Avci

With this update you can now make your own steering wheel and pedal set for the racing game 
you always wanted to play with controller!

You need an MPU6050 IMU sensor for this project, simply connect SDA and SCL pins to A4 and A5 respectively,
VCC -> 5V GND->GND

or you can use the SDA SCL pins on Arduino close to the GND pin if you need more analog inputs.
    You can find the program for the gaming 900 degree wheel set on the UnoJoySteeringWheel folder.
Upload the program and follow the instructions!

Feel free to contact me for any problems on the program : [email protected]
Mustafa Cem Avci, 17/06/2020
LONG LIVE OPEN SOURCE!  

YouTube: https://www.youtube.com/watch?v=Rq2QivBzshs

unojoy's People

Contributors

alanchatham avatar cmavc avatar erbonator3000 avatar

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

unojoy's Issues

Atmel FLIP tool - Is there another location to get it?

Is there another way to download the Atmel FLIP tool? The provided URL redirects to microchip.com. I did some searching for this, but I haven't found anything that makes sense for this. Also, is there an installer for it, or do I simply register it with a command prompt? I'm using Windows 10.

Can we get a guide on how to do this on a Leonardo board?

Hey, been looking into UnoJoy for a while. Looks like a cool project but haven't been able to find a setup guide for the Leonardo board. I have uploaded the Uno Sample Sketch and Leonardo Sample Sketch. The pins you say to short are not there and even when I connect the RESET and GND pin headers together no, DFU devices pops up and the Linux script doesn't work.

Any guide or help would be appreciated to get this to work.

MegaJoy doesn't recognzie inputs on one PC

Hello,

I just installed MegaJoy on an Arduino Mega R3. Everything runs fine on my notebook. Two game controllers are recognized, inputs are displayed in the Windows (10 Pro) game controller settings. If I connect this Arduino Mega to my game PC (also Windows 10 Pro), the two game controllers are also recognized, but inputs are not. Drivers shouldn't be necessary with a HID device? I still installed the Arduino IDE, Flip and everything as a test, nothing brings anything ... Where could my mistake be?

mega not working

hey
i have a arduino mega that i try to make a buttonbox with.
i cant get my mega to push a button in that window with unojoy. it shows op, but nothing happen when i mage a connection
hop that you can help me

UnoJoyDriverInstall.bat

When I tried to install the drivers by running the bat file the drivers didn't install. Only one did: libusb-win32.

MegaJoy + Bluetooth

Hi Alan! I just tried an 8BitDo joystick and must admit: it's awesome.
By the way, just sent it back to the seller. I want to do my joystick at all.

That's why I'm asking you if you ever tried to make UnoJoy working via Bluetooth.
I already have a bluetooth module for Arduino and really want to do that.

Let me know if you have any suggestion :)

Thanks,
Mirco

It's possible control six axes with Unojoy?

Hi I'm building some gauges for my home cockpit of te Beech Craft B58 to use with the flight simulator Prepar3d.
I would make the throttle group, that have six indipendent levers, with six potentiometers.
For this reason I would use Unojoy (and not megajoy for space reason) where i would plug the six potentiometer to A0, A1, A2, A3, A4 and A5 pin, it's possible? If yes, can you help me for the code?
Thanks and sorry for bad english.
Regards

Cannot run the visualizer

When I try to run the processing visualizer, i get this error:

Could not find the main class. Program will exit.

I am thinking that this might be a JRE version issue or something. Have you seen this before? I am running the latest version of UnoJoy here with JRE v. 1.8.0_66. I have tried running the standalone EXE, as well as the jar by itself. Both give me the same error. I am not super fluent in Java, so it might be a config issue. Any help would be appreciated.

Issues with Encoder Rotary with MegaJoy

i'm using MegaJoy, I want to connect two rotary encoders. But for some reason, Megajoy sometimes doesn't read the encoder when I turn it. Has anyone tested an encoder on UnoJoy / MegaJoy?

Rotary Encoder on UnoJoy With SimpleRotary Library

Hello,

I know this has been asked several times before however I am new to UnoJoy and would like some help. I would like to connect a simple rotary encoder (EC11) as a axis. The code works when I test it in Serial Monitor however when I bootload the UnoJoy things, it doesn't work. I am using the SimpleRotary Library. I have attached my code below. What should I change? If you have better ideas than the way I am coding it, please let me know.

/*
 
#include <SimpleRotary.h>
#include "UnoJoy.h"
int degree = 127;
int newDegree = 127;

// Pin A, Pin B, Button Pin
SimpleRotary rotary(6, 5, 7);

void setup() {
  //Serial.begin(9600);
  setupUnoJoy();
}

void loop() {
  getData();

 
  dataForController_t controllerData = getControllerData();
  setControllerData(controllerData);
}
void getData()
{
    byte i;

  // 0 = not turning, 1 = CW, 2 = CCW
  i = rotary.rotate();

  if ( i == 1 ) {
    //Serial.println("CW");
    newDegree = degree + 5;
    if (newDegree < 255)
    {
      degree = degree + 5;
      //Serial.println(degree);
      return degree;
      //analogWrite(9, degree);
    }


  }

  if ( i == 2 ) {
    //Serial.println("CCW");
    newDegree = degree - 5;
    if (newDegree > 0)
    {
      degree = degree - 5;
      //Serial.println(degree);
      //analogWrite(9, degree);
      return degree;
    }
  }
}


dataForController_t getControllerData(void){
  
  // Set up a place for our controller data
  //  Use the getBlankDataForController() function, since
  //  just declaring a fresh dataForController_t tends
  //  to get you one filled with junk from other, random
  //  values that were in those memory locations before
  dataForController_t controllerData = getBlankDataForController();

  
  // Set the analog sticks
  //  Since analogRead(pin) returns a 10 bit value,
  //  we need to perform a bit shift operation to
  //  lose the 2 least significant bits and get an
  //  8 bit number that we can use  
  controllerData.leftStickX = getData();
  
  
  // And return the data!
  return controllerData;
}

MegaJoy with Seeed Can bus shield

I'm using a MegaJoy, I have it operating just fine as a joystick using analogue inputs with X360ce as my emulator.

For the project that I am working on though, I need to do more with the signals generated by the analogue joystick. So I have implemented the Seeed CAN bus shield to allow comms between another plc and the arduino. The communication works great, until I turn the mega in to joystick. The signals being processed by the emulator become far-far away from the inputs that I am sending to the analogAxisArray...Any particular reason you know of as to why this wouldn't work?

--force needed on Mac OS X Catalina

First of all, under catalina the path to the USB analysis is different:
About this Mac > System report... and so on.

Then, when in DFU mode, the Arduino is seen Composite Device.

Then, I had this error running the script to get it back to an Arduino:

$ sh TurnIntoAnArduino.sh
.
Like magic.
Trying to program for Arduino Uno R1/R2...
dfu-programmer: no device present.
We didn't find the R1/R2 model, checking for an R3...
Checking memory from 0x0 to 0xFFF...  Not blank at 0x1.
The target memory for the program is not blank.
**Use --force flag to override this error check.**

dfu-programmer couldn't connect to the Arduino...
Did you put the Arduino into DFU mode?
Did you run the script as a root user?

Solved it by adding the --force option to the dfu-programmer script:
dfu-programmer atmega16u2 flash Arduino-usbserial-uno.hex --force

Done. Don't want to pull a request with the --force param into it.
Instead, I think that when the shell says "Use --force flag..." should be handled by the TurnIntoAnArduino.sh this way:

$ sh TurnIntoAnArduino.sh --force

And yes, I'm not a bash addicted, so I can't provide you a pull request. I'm sorry :)

Not turning back into an arduino

I turned my arduino into an joystick prety long ago, now i want to go back but i can't. I get a error saying "could not find a java virtual machine, cannot continue", so i added Java to PATH. After that i got an error saying "Could not fid AtJniIsp.dll" i downloaded that file and put it in the \ATmega8u2Code\HexFiles folder and then i get the "could not find a java virtual machine, cannot continue" error again. Can someone please help me with this

Differing names for Megajoy Devices

Is it possible to set two different names for the two devices that show up when using Megajoy?
(instead of using UnoJoy Joystick two times, just use UnoJoy Joystick1 and UnoJoy Joystick2)
Some games (especially Unity Games) can't handle it when two devices have the same Name.

use with Arduino Pro Micro on linux

is it possible to setup this with an Arduino Pro Micro on linux?

is it ok if i just copy the hardware profile from LeoJoy/hardware/leojoy into my sketchbook/hardware?

side question: was the PS/home button implemented in this version?

Accelerometer Joystick

Hi,i want to use accelerometer as a joystick.So, i created 2 program.One for the unojoy program and the other for the accelerometer conversion.I created 2 program because of that one arduino is powerless to manage the unojoy programm and the accelerometer conversion.
But when i switch to joystick the accelerometer is not recognizes.

Arduino program
``
#include "UnoJoy.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(13,12); // RX, TX

void setup(){
setupPins();
setupUnoJoy();

mySerial.begin(9600);
//Serial.begin(9600);
}

void loop(){
// Always be getting fresh data
dataForController_t controllerData = getControllerData();
setControllerData(controllerData);
}

void setupPins(void){
// Set all the digital pins as inputs
// with the pull-up enabled, except for the
// two serial line pins
int var ;
for (int i = 2; i <= 12; i++){
pinMode(i, INPUT);
digitalWrite(i, HIGH);
}
pinMode(A4, INPUT);
digitalWrite(A4, HIGH);
pinMode(A5, INPUT);
digitalWrite(A5, HIGH);
}

dataForController_t getControllerData(void){

int anx;
int anxj;
int any;
int nombreEnCours = 0;
int continu=0;

// Set up a place for our controller data
// Use the getBlankDataForController() function, since
// just declaring a fresh dataForController_t tends
// to get you one filled with junk from other, random
// values that were in those memory locations before
dataForController_t controllerData = getBlankDataForController();
// Since our buttons are all held high and
// pulled low when pressed, we use the "!"
// operator to invert the readings from the pins
controllerData.triangleOn = !digitalRead(2);
controllerData.circleOn = !digitalRead(3);
controllerData.squareOn = !digitalRead(4);
controllerData.crossOn = !digitalRead(5);
controllerData.dpadUpOn = !digitalRead(6);
controllerData.dpadDownOn = !digitalRead(7);
controllerData.dpadLeftOn = !digitalRead(8);
controllerData.dpadRightOn = !digitalRead(9);
controllerData.l1On = !digitalRead(10);
controllerData.r1On = !digitalRead(11);
controllerData.selectOn = !digitalRead(12);
controllerData.startOn = !digitalRead(A4);
// controllerData.homeOn = !digitalRead(A5);

// Set the analog sticks
// Since analogRead(pin) returns a 10 bit value,
// we need to perform a bit shift operation to
// lose the 2 least significant bits and get an
// 8 bit number that we can use
anxj=analogRead(A0);
controllerData.leftStickX = anxj >> 2;
controllerData.leftStickY = analogRead(A1) >> 2;

continu=0;
//Serial.println();
while (mySerial.available()&& continu==0)
{

                 char c = mySerial.read();
     //Serial.print(c); 
    // Si c'est un chiffre, on l'ajoute au nombre
    if ( ( c >= '0' ) && ( c <= '9' ) ) {
        nombreEnCours = ( ( nombreEnCours * 10 ) + ( c - '0' ) );
    }
     
    // Si c'est une lettre majuscule, alors on fait une action
    if ( ( c >= 'A' ) && ( c <= 'Z' ) ) {
         
        // Pour un 'A', on affiche un texte
        if ( c == 'X' ) {
            anx=nombreEnCours;
            //Serial.println(anx); 
            
            //Serial.println(controllerData.rightStickX);
        }
        
        if ( c == 'Y' ) {
            any=nombreEnCours;
            //Serial.println(any);
            //Serial.println();
            continu=1;
        }
        
        // Puis on revient à 0
        nombreEnCours = 0;
            // int var = mySerial.read();

              }
              }


              

  controllerData.rightStickX = (anx) >> 2; 
  controllerData.rightStickY = (any) >> 2; 
        
   //Serial.println(anx);
   //Serial.println(controllerData.rightStickX); 
  
              
              //Serial.println (controllerData.rightStickX);
              //Serial.println(anx);                  
              //Serial.println(controllerData.leftStickX);
              //Serial.println();

/* controllerData.rightStickX = analogRead(A2) >> 2;
controllerData.rightStickY = analogRead(A3) >> 2;
*/

// And return the data!
return controllerData;
}
"
If anyone could help

Not issue.. 4 controllers in megajoy

Is posible to have 4 controllers using arduino mega? I use the "megajoy" and we have a Lot of buttons and analogs inputs on each controllers. So I think that should be cool to have 4 controllers with 12 digital inputs and 3 analogs inputs each one. ( Sorry my english. im from Argentina)

Logitech G2x shifter interfacing with MegaJoy

Hello, i'm trying to interface analog-based H-shifters, just like the common and available shifters from Logitech for the G series (G25, G27, and Logitech Driving Force Shifter for the G29/G920)
I'm not a programmer in any means or stretch, just one enthusiast wanting to build something more integrated, so i don't need to have multiple boards for each part of the simulation mechanisms.
With some code from the youtuber AMStudio, i got the basics of the interface (it actually works, changing the position of the analog axis activates the button), but it lags a lot (from 1,5 up to 5 seconds between shifts), while the other buttons work just as fast as they always worked, i would like to know how can i optimize it to shift faster

the file is for MegaJoy:
MegaJoyArduinoG2xShifter.txt

Minor bug

Something I just found while looking through the code. Outcomment this line, maybe in other examples as well:
https://github.com/AlanChatham/UnoJoy/blob/master/UnoJoy/Examples/PaintController/UnoJoy.h#L195

I did a very similar project (see current dev version, its better and will be merged in 2 days):
https://github.com/NicoHood/HID

In combination with your Arduino Uno Firmwares this could be very useful while debugging the code (also dev branch):
https://github.com/NicoHood/HoodLoader2
You dont have to flash the firmware over and over, just put the 16u2 into bootloader mode to update the 328 again.

I am also planning on working on some 16u2 hardcoded firmwares. Meaning they will receive data via Serial and translate it to usb. One problem I noticed was: What will you do if the USB Host is too slow and does not read in the data fast enough (like a raspberry pi). How do you send an acknowlegde back to the 328 or how do you solve this problem? Maybe we could work together on that and create a proper API and Protocol for this. If you are interested contact me on www.nicohood.de

increase resolution

Hi,
I use UnoJoy for connecting my model transmitter with my PC to use as controller for flight simulators. This works great, but the resolution could be improved.
Is it possible to extend the value range to 16bit? I have an input resolution of 1000 values.

Thanks!
Paul

Add jstest-gtk to docs as a testing option for Linux users

jstest-gtk is a simple tool that allows you to visualize button inputs and so on without configuring Processing and Java. Windows may have a built-in utility for this in Device Manager.

I have tested & verified that the out-of-the-box example for the Uno R3 works with this tool!

Increase resolution 2

Hi,
I read a previous question about increase resolution in UnoJoy but I kind of not understand it fully. My electronics skills are very limited. Sorry for that!
MegaJoy firmware was mentioned to increase resolution but the MegaJoy IDE file relates to Arduino Mega that have many more analog inputs.
My project is to mod a set of racing pedals so I just need 2 or 3 axis, no buttons. Found UnoJoy to be an excellent option until I realize it will reduce resolution to 8 bits and I believe 256 steps is a downgrade of my actual system and maybe not enough.
PaulElsner uploaded few files but I could not identify a .bat and the .ino files I hope to be using. Also I don't need to read PWM signal since my inputs would be analog data
Could someone please tell me which firmware and sketch should I be using and which edits do they require?

arduino nano

I understand this has been answered before and you cant use this unojoy on the arduino nano as it has not got the ftdi chip for USB coms, is it possible to flash the little ftdi boards you get that are used to program the pro mini? Basically having that connected to a pro mini or nano but using the extra board as the USB link to the pc?

Thanks
Don

Raising the amount of buttons on megajoy

Hi

Im trying to make som flightsim hardware as cheaply as possible. So i started using this, and it works great with 64 buttons. But when i edit the descriptor and everything to add more buttons. as an example im using 80 buttons for this project. The buttons 64-71 (8 buttons which is exactly 1 byte of buttons) doesnt work. i have looked through the descriptor and everything, and i can't find out why this 1 byte of buttons doesn't work.

20190101_230951
Here is a gif of what im talking about. I made the arduino cycle through the buttons from 0-79 and then repeat. As seen on the gif, every button works exept those 8 buttons.

I also tried one time changing the amount of buttons to 144, her there are 16 buttons that doesn't work. more specifically buttons 64-71 and 128-135. So it seems to behappening after every 8th byte.

SOME UNOJOY (uno board) Q's.. 2022 Plz. help!

🔴 I have some questions about UNOJOY with ARDUINO UNO board.

A) Can I send 10bit analogue axis data to PC ?
B) Can I get more input pins like megajoy ?
( physically with Button array or Keypad can extend the input pins of Arduino Uno)
* 12 digital inputs not enough.
* try to edit source (Unojoy.h) files to add more pins but it didn't work.
C) Is it possible get PC data output to arduino ?
* For use to display speed, gears or hypic feedback
D) Can I use ESP Chip instead of Arduino?

If you know some ideas or new please Comment....

Can't load jvm.dll

Windows 7:
When running "TurnIntoAJoystick.bat" I get "Can't load jvm.dll"

Did I install Atmel Flip Program? Yes
Is the arduino plugged in? Yes
Is it in 'Arduino Uno DFU' mode? Yes

I tried symlinking the jvm.dll in from several location TO several locations.
First it was in the same folder as TurnIntoAJoystick.bat , but nothing
I then found where batchisp was installed and put it there, nothing.
I then placed it in ATmega8u2Code\HexFiles nothing
Placed C:\Program Files\Java\jdk1.7.0_45\jre\bin\server on %PATH%, nothing

So now I am afraid I am at an end to the tricks I can think of.. If anyone else can help?

  • Colin

Need to restart Windows (or cut data from USB for a second) if USB unplugged

Hi! I´m using the DoubleJoy version with an Arduino Mega R3.

DoubleJoy-19June2012.zip | DoubleJoy code - Beta - Turn 1 Arduino into 2 joysticks!  Type-Archive  OpSys-All  Beta | Jun 18, 2012 | 235.88KB

When I plug the Arduino (with DoubleJoy.hex) It is recognized as a gamepad but for some reason, the buttons are freezed and the analog as well. I have to restart the OS to get it working.

However I can get it work also if I:

  1. Unplug the USB
  2. Break the data cables
  3. Plug the USB (giving only power to the Arduino)
  4. Wait 4 or 5 seconds
  5. Join again the data cables

I´ve tested cutting the data cables for a moment after plugging the USB and it did not work.
It seems to need to finish to boot before Windows recognize it.

Do you know any (other, non phisicall) workaround for this.

Thanks and regards!

Is it possible to send data from the PC and handle it in the arduino?

Hi @AlanChatham @Erbonator3000

Im working on a personal project to build a home made autopilot quadrant for x-plane. This is a good approach considering that I just need to map the buttons to a profile in x-plane. This simplify the coding for the inputs if use a regular COM serial port communication (simplify a lot)

The things is that I'm having 2 display TM1637 that need to be update it with the values that I can get from the sim but I need to send it back to the Arduino to update the displays.

Suggestion are wellcome!

Thanks!

Arduino Uno Bricked

After following the instructions, putting the Arduino Uno r3 into DFU mode and running the batch file, I receive an error. After this I was unable to get the chip back out of DFU mode and ended up throwing the chip away.

I think you should make it more clear, what the risks are for following your instructions.

Megajoy on Linux only sees 1 gamepad report

Hi,

I'm using MegaJoy on Linux Mint 19.

I'm not sure if this is an issue with MegaJoy or with the new Linux evdev system, but I'm only getting one gamepad report (6 x axis + 32 buttons) on the joystick device. This means that the second set of inputs are not visible.

On Windows, Megajoy installs as 2 joysticks, and everything works as expected.

Has anyone else noticed this and have a solution?

Thank you.

Error line 147 Megajoy.h

controllerDataBuffer = getBlankDataForController();

should read:

controllerDataBuffer = getBlankDataForMegaController();

DPAD buttons behave incorrect on PS3 (fix)

I have succesfully connected my old Negcon controller to the PS3 with Unojoy, so many thanks for making that possible! However, the (DPAD) directional buttons were all wrong in the game menu (Wipeout HD) while they were working fine in the PS3 main menu.

Looking further into this issue I found that the PS3 expects the DPAD buttons to return a digital value as well as an analogue (sensitivy) value. It seems that Unojoy interprets these analogue values incorrect, as you might suspect when you read the following code snippet. :-)

// Gonna assume these are button analog values for the d-pad.
// NOTE: NOT EVEN SURE THIS IS RIGHT, OR IN THE CORRECT ORDER
uint8_t up_axis;
uint8_t right_axis;
uint8_t down_axis;
uint8_t left_axis;

So I rearranged the lines in usb_gamepad.h as shown below, built a new hexfile and now the DPAD buttons behave correctly in the Wipeout game menu too.

uint8_t right_axis;
uint8_t left_axis;
uint8_t up_axis;
uint8_t down_axis;

Hopefully this helps anybody, I'm back to racing! Thanks again.

Will this library work on Arduino Nano Atmega 328

Hello,
when I try to upload the UnoJoyArduinoSample to my Arduno Nano,
I get
Invalid library found in C:\Program Files (x86)\Arduino\libraries\UnoJoy-master: C:\Program Files (x86)\Arduino\libraries\UnoJoy-master
Nowere is written that the library is compatible with Nano, is there a way to run it ?

extra axis

thanks for this beautiful code
how can add extra axis to megajoy ?
12 axis

How do you compile a new hex bootloader file?

Hi Alan,

I am using your code to try to interface with the Original Xbox. I have modified the usb_gamepad.c file, but I don't know how to compile into a hex bootloader file to test it.

Can you please recommend how I should go about compiling?

Arduino/Genuino 101 support

Hi, thanks for the great work, is there any chance this may be compatible with an Arduino/Genuino 101? It would be very cool to use the sensors as inputs for a gamepad. Any plans in adding a support for this board?
Thanks!

License?

What license is this code under? There's no LICENSE file

Not a bug, I'm just missing something (probably obvious)

I can switch back and forth from arduino to joystick, no problem. And I can use the UnijoyArduinoSample and a Serial.println() to apply a function to remap an analog pin to what I need (from 226-32 to 0-255). I can move the axis and see that it's reading what I need through the serial monitor.

What I can't figure out is how to use that code as what's used to make the Uno a joystick. I tried replacing the UnoJoy\ATmega8u2Code\HexFiles\UniJoy.hex file with my own compiled from my edited sample, but I got an out-of-range error when running TurnIntoAJoystick.bat.

I didn't expect it to work, but I also tried just TurnIntoAJoystick.bat after my edited sample on the board. My expectations were not unmet.

Any help would be appreciated.

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.