Problem with Arduino Joystick -Help!

Moderators: Uros, Tom, OXO

391P
Posts: 8
Joined: Tue Jul 16, 2019 9:15 pm
Location: Hannover, Germany

Problem with Arduino Joystick -Help!

Post by 391P » Sat Jul 20, 2019 8:41 am

### English Version ###

Good morning, everyone.

I've been using the Condor Simulator version 1 for several years now and this year I've decided to take the whole thing to a new level for myself. So I bought an old glider body and built my own simulator. Basically I have a good technical understanding (computer, joystick, etc) but now I have a problem and need your help.

For the controls in the simulator I want to use my own joystick. For this I decided to use an Arduino Leonardo. There are several instructions and sample code on the internet, so I followed this trend! Currently I have created a prototype which shows the main functions (elevator, aileron, rudder and some buttons).

My problem:
The Arduino joystick is recognized by Windows 7 and Windows 10 as a game controller. I can also try it out and calibrate it properly. As soon as I open the Condor Simulator it is not recognized and I cannot use it!

ImageImage

My question:
What do I have to consider or change / perform so that the Arduino Joystick can be used by the Condor Simulator. Other simulators like Microsoft Flight Simulator or UbiSoft IL2 recognize it without problems.

Funfact:
The Condor Simulator version 1.0.5 recognizes the Arduino joystick, but does not allow configuration. With each following version the support is no longer given.

Image

Condor 1.0.5 - works!
Condor 1.0.6 - does not work!
Condor 1.0.12 - does not work!
Condor 1.0.14 - does not work!
Condor 1.0.15 - does not work!
Condor 2.0.7 - does not work!
Condor 2.0.8 - does not work!

I'd be very happy if you could help me with my problem. There is surely someone here who has done a similar project or problem.

Thank you very much for your support.
391P


Instructions for the Arduino Joystick:
https://www.instructables.com/id/Arduin ... rJoystick/

Program code / library for the Arduino:
https://github.com/MHeironimus/ArduinoJ ... ersion-2.0

My customized Code:

Code: Select all

// Program JoyStick für Flugsimulator
// 
//------------------------------------------------------------

#include "Joystick.h"

// Create Joystick
Joystick_ Joystick;

// Set to true to test "Auto Send" mode or false to test "Manual Send" mode.
const bool testAutoSendMode = true;
//const bool testAutoSendMode = false;

const unsigned long gcCycleDelta = 1000;
const unsigned long gcAnalogDelta = 25;
const unsigned long gcButtonDelta = 500;
unsigned long gNextTime = 0;
unsigned int gCurrentStep = 0;

int xAxis = 0;
int yAxis =0;

int rzAxis = 0;

int Throttle = 0;
int RudderRange = 0;

boolean taster1;
boolean taster2;
boolean taster3;
boolean taster4;
boolean taster5;
boolean taster6;

void setup() {
  
  Serial.begin(9600);
  // Set Range Values
  
  Joystick.setXAxisRange(0, 1023);
  Joystick.setYAxisRange(0, 1023);

  Joystick.setRzAxisRange(0, 1023);
  
  Joystick.setThrottleRange(0, 1023);
  Joystick.setRudderRange(0, 1023);
  
  if (testAutoSendMode)
  {
    Joystick.begin();
  }
  else
  {
    Joystick.begin(false);
  }
  
  //pinMode(A0, INPUT);
  pinMode(13, OUTPUT);
  pinMode(12, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);

}

void loop() {

  xAxis = analogRead(A0);
  yAxis = analogRead(A1);
  
  rzAxis = analogRead(A2);

  Throttle = analogRead(A3);
  RudderRange = analogRead(A4);
  
  taster1=digitalRead(12);
  taster2=digitalRead(11);
  taster3=digitalRead(10);
  taster4=digitalRead(9);
  taster5=digitalRead(8);
  taster6=digitalRead(7);
  // Turn indicator light on.
  digitalWrite(13, 1);
  //xAxis = int((bA0-512)/2);

  Serial.print("xAchse=");
  Serial.print(xAxis,DEC);
  Serial.print(" yAchse=");
  Serial.print(yAxis,DEC);
  
  Serial.print(" rzAchse=");
  Serial.println(rzAxis,DEC);

  Serial.print("Throttle=");
  Serial.print(Throttle,DEC);
  Serial.print(" RudderRange=");
  Serial.println(RudderRange,DEC);
  
    Serial.print(" Taster1=");
  Serial.print(taster1);
    Serial.print(" Taster2=");
  Serial.print(taster2);
    Serial.print(" Taster3=");
  Serial.println(taster3);
  
    Serial.print(" Taster4=");
  Serial.print(taster4);
    Serial.print(" Taster5=");
  Serial.print(taster5);
    Serial.print(" Taster6=");
  Serial.println(taster6);
  
  Joystick.setXAxis(xAxis);
  Joystick.setYAxis(yAxis);
  Joystick.setRzAxis(rzAxis);

  Joystick.setThrottle(Throttle);
  Joystick.setRudder(RudderRange);

  if (taster1) {
    Joystick.releaseButton(0);
  } else {
    Joystick.pressButton(0);
  }
  if (taster2) {
    Joystick.releaseButton(1);
  } else {
    Joystick.pressButton(1);
  }
  if (taster3) {
    Joystick.releaseButton(2);
  } else {
    Joystick.pressButton(2);
  }
  if (taster4) {
    Joystick.releaseButton(3);
  } else {
    Joystick.pressButton(3);
  }
  if (taster5) {
    Joystick.releaseButton(4);
  } else {
    Joystick.pressButton(4);
  }
  if (taster6) {
    Joystick.releaseButton(5);
  } else {
    Joystick.pressButton(5);
  }

  Joystick.sendState();

  delay(0);
}

### German Version ###

Guten morgen zusammen.

Ich nutze den Condor Simulator bereits seit einigen Jahren in der Version 1 und habe mich in diesem Jahr dazu entschlossen, das ganze Thema für mich auf ein neues Level zu heben. Entsprechend habe ich mir einen alten Segelflugzeug-Rumpf gekauft und baue mir meinen eigenen Simulator. Grundsätzlich habe ich ein gutes Technik-Verständnis (Computer, Joystick, etc) jedoch habe ich nun ein Problem und benötige Eure Hilfe.

Für die Steuerung im Simulator möchte ich einen eigenen Joystick benutzen. Hierzu habe ich mich für einen Arduino Leonardo entschieden. Es gibt im Internet hierzu diverse Anleitungen und Beispielcode, sodass ich diesem Trend gefolgt bin! Derzeit habe ich ein Prototyp erstellt, der die wesentlichen Funktionen (Höhenruder, Querruder, Seitenruder und ein paar Knöpfe) abbildet.

Mein Problem:
Der Arduino Joystick wird von Windows 7 und Windows 10 als Gamecontroller erkannt. Ich kann auch diesen ordnungsgemäß ausprobieren und kalibrieren. Sobald ich den Condor Simulator öffne wird er jedoch nicht erkannt und ich kann ihn nicht benutzen!

ImageImage

Meine Fragestellung:
Was muss ich beachten oder ändern / durchführen, damit der Arduino Joystick vom Condor Simulator verwendet werden kann. Andere Simulatoren wie z.B. Microsoft Flight Simulator oder UbiSoft IL2 erkennen ihn problemlos.

Funfact:
Der Condor Simulator in der Version 1.0.5 erkennt den Arduino Joystick, lässt jedoch die Konfiguration nicht zu. Mit jeder Folgeversion ist die Unterstützung nicht mehr gegeben.

Image

Condor 1.0.5 - funktioniert!
Condor 1.0.6 – funktioniert nicht!
Condor 1.0.12 – funktioniert nicht!
Condor 1.0.14 – funktioniert nicht!
Condor 1.0.15 – funktioniert nicht!
Condor 2.0.7 – funktioniert nicht!
Condor 2.0.8 – funktioniert nicht!

Ich würde mich sehr freuen, wenn ihr mir bei meinem Problem helfen könntet. Es gibt sicherlich hier jemanden, der ein ähnliches Problem oder ein ähnliches Projekt durchgeführt hat.

Vielen Dank für Eure Unterstützung.
391P


Anleitung für den Arduino Joystick:
https://www.instructables.com/id/Arduin ... rJoystick/

Programm-Code / Library für den Arduino:
https://github.com/MHeironimus/ArduinoJ ... ersion-2.0

Code: Select all

// Program JoyStick für Flugsimulator
// 
//------------------------------------------------------------

#include "Joystick.h"

// Create Joystick
Joystick_ Joystick;

// Set to true to test "Auto Send" mode or false to test "Manual Send" mode.
const bool testAutoSendMode = true;
//const bool testAutoSendMode = false;

const unsigned long gcCycleDelta = 1000;
const unsigned long gcAnalogDelta = 25;
const unsigned long gcButtonDelta = 500;
unsigned long gNextTime = 0;
unsigned int gCurrentStep = 0;

int xAxis = 0;
int yAxis =0;

int rzAxis = 0;

int Throttle = 0;
int RudderRange = 0;

boolean taster1;
boolean taster2;
boolean taster3;
boolean taster4;
boolean taster5;
boolean taster6;

void setup() {
  
  Serial.begin(9600);
  // Set Range Values
  
  Joystick.setXAxisRange(0, 1023);
  Joystick.setYAxisRange(0, 1023);

  Joystick.setRzAxisRange(0, 1023);
  
  Joystick.setThrottleRange(0, 1023);
  Joystick.setRudderRange(0, 1023);
  
  if (testAutoSendMode)
  {
    Joystick.begin();
  }
  else
  {
    Joystick.begin(false);
  }
  
  //pinMode(A0, INPUT);
  pinMode(13, OUTPUT);
  pinMode(12, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);

}

void loop() {

  xAxis = analogRead(A0);
  yAxis = analogRead(A1);
  
  rzAxis = analogRead(A2);

  Throttle = analogRead(A3);
  RudderRange = analogRead(A4);
  
  taster1=digitalRead(12);
  taster2=digitalRead(11);
  taster3=digitalRead(10);
  taster4=digitalRead(9);
  taster5=digitalRead(8);
  taster6=digitalRead(7);
  // Turn indicator light on.
  digitalWrite(13, 1);
  //xAxis = int((bA0-512)/2);

  Serial.print("xAchse=");
  Serial.print(xAxis,DEC);
  Serial.print(" yAchse=");
  Serial.print(yAxis,DEC);
  
  Serial.print(" rzAchse=");
  Serial.println(rzAxis,DEC);

  Serial.print("Throttle=");
  Serial.print(Throttle,DEC);
  Serial.print(" RudderRange=");
  Serial.println(RudderRange,DEC);
  
    Serial.print(" Taster1=");
  Serial.print(taster1);
    Serial.print(" Taster2=");
  Serial.print(taster2);
    Serial.print(" Taster3=");
  Serial.println(taster3);
  
    Serial.print(" Taster4=");
  Serial.print(taster4);
    Serial.print(" Taster5=");
  Serial.print(taster5);
    Serial.print(" Taster6=");
  Serial.println(taster6);
  
  Joystick.setXAxis(xAxis);
  Joystick.setYAxis(yAxis);
  Joystick.setRzAxis(rzAxis);

  Joystick.setThrottle(Throttle);
  Joystick.setRudder(RudderRange);

  if (taster1) {
    Joystick.releaseButton(0);
  } else {
    Joystick.pressButton(0);
  }
  if (taster2) {
    Joystick.releaseButton(1);
  } else {
    Joystick.pressButton(1);
  }
  if (taster3) {
    Joystick.releaseButton(2);
  } else {
    Joystick.pressButton(2);
  }
  if (taster4) {
    Joystick.releaseButton(3);
  } else {
    Joystick.pressButton(3);
  }
  if (taster5) {
    Joystick.releaseButton(4);
  } else {
    Joystick.pressButton(4);
  }
  if (taster6) {
    Joystick.releaseButton(5);
  } else {
    Joystick.pressButton(5);
  }

  Joystick.sendState();

  delay(0);
}


User avatar
wickid
Posts: 2420
Joined: Mon Dec 04, 2006 7:32 pm
Location: Venlo, NL
Contact:

Re: Problem with Arduino Joystick -Help!

Post by wickid » Sat Jul 20, 2019 12:15 pm

I did what you are trying with a POkeys 57U board. It is plug and play and the software to set it up is very userfriendly. It is recognised by Condor 1 and Condor 2 out of the box.

https://www.poscope.com/product/pokeys57u/
PH-1504, KOE

391P
Posts: 8
Joined: Tue Jul 16, 2019 9:15 pm
Location: Hannover, Germany

Re: Problem with Arduino Joystick -Help!

Post by 391P » Tue Jul 23, 2019 6:00 pm

### English Version ###

Hello wickid.
Thank you for your quick feedback. This is a good tip, thank you very much for it. But first of all I want to control the simulator with the Arduino. Therefore I keep the approach about the Pokeys 57U Board as Plan B.

The Arduino is also Plug & Play and under Win7 / Win10 it is automatically configured as game controller. From my point of view this is a big advantage!

What can I do so that the Condor automatically detects the rowing movements? As mentioned in the first version 1.0.5 the Arduino is completely and correctly recognized. Not anymore with all following versions?

Do I have to consider or adhere to any parameters? Is there any information I need to include in the Arduino?

Thank you very much for your feedback.
391P

### German Version ###

Hallo wickid.
Danke für deine schnelle Rückmeldung. Das ist ein guter Tipp, vielen Dank dafür. Ich möchte jedoch in erster Linie den Simulator mit dem Arduino steuern. Daher behalte ich den Ansatz über das Pokeys 57U Board als Plan B.

Der Arduino ist auch Plug & Play und unter Win7 / Win 10 wird er automatisch als Gamecontroller konfiguriert. Das ist aus meiner Sicht ein großer Vorteil!

Was kann ich machen, dass der Condor automatisch die Ruderbewegungen erkennt? Wie gesagt in der ersten Version 1.0.5 wird der Arduino vollständig und korrekt erkannt. Mit allen folgenden Versionen nicht mehr?

Muss ich irgendwelche Parameter berücksichtigen oder einhalten? Gibt es Informationen die ich im Arduino mitliefern muss?

Vielen Dank für die weiteren Rückmeldungen.

User avatar
EDB
Posts: 1575
Joined: Mon Oct 31, 2011 1:17 am
Location: The Netherlands, Europe Continent, Earth Planet, Milky Way Galaxy, Virgo Super Cluster

Re: Problem with Arduino Joystick -Help!

Post by EDB » Tue Jul 23, 2019 9:33 pm

I think the Arduino community is a better place to ask these questions.

I personally would have looked at Leo Bodnar boards or maybe what Wickid suggested...

User avatar
BeastFromTheEast
Posts: 445
Joined: Fri Dec 14, 2012 12:21 am
Location: Ipswich, Suffolk

alternative to arduino joystick

Post by BeastFromTheEast » Tue Jul 23, 2019 11:19 pm

EDB wrote:
Tue Jul 23, 2019 9:33 pm
I personally would have looked at Leo Bodnar boards or maybe what Wickid suggested...
I have a virtual cockpit setup with the Bodnar 8 axis / 36 button USB joystick card and it works absolutely fine with both Condor 1 and 2.

The Bodnar card is intended to be interfaced with electromechanical devices (switches / potentiometers) but I have found digital to analogue converters for the analogue channels and opto isolators for the digital ones seems to patch in just fine.

There are no potentiometers in the rig anywhere ..... all the axes are resolved using IMUs (motion sensing circuit boards)

Ian
You can take the Beast from the East
But never the East from the Beast
Image
Beastly Soaring - Tuesday nights, on the ServerOfTheBeast
Competition number IFC, aircraft registration number G-CHQR

391P
Posts: 8
Joined: Tue Jul 16, 2019 9:15 pm
Location: Hannover, Germany

Re: Problem with Arduino Joystick -Help!

Post by 391P » Wed Jul 24, 2019 9:30 am

### English Version ###

Hello you two and many thanks for the feedback.

@EDB: In the Arduino Community the procedure, the implementation and the use have already been checked. With a positive result. Here I was asked to contact the manufacturer. The manufacturer referred me to this forum?

It seems to be a specific Condor problem that all other simulators (FS 2004, FS X, IL2, Sailors of the Sky, FlightGear) recognize the Arduino joystick. At the risk of repeating myself - the support was once given! Maybe it is possible to restore it?

I am willing to support the condor team as a test person.

@EDB: I found your contribution from last year. Was there a complete solution? Is there anyone who has managed the problem without additional software but plug and play with an Arduino? viewtopic.php?f=31&t=18309

Is there a guide how I can set the settings for Condor? Maybe via Controller.ini - Unfortunately I don't quite understand the procedure from your article here!

@BeatFromTheEast: I think this variant will still be my plan B. Which components do I need if I want to work with potentiometers and buttons on the Leo Bodnar Board? I don't fully understand your contribution and would appreciate some more details via PM. Thank you very much.

I would be happy to hear from members who already have an Arduino solution in use and could support me. I have already spent enough time on this topic to avoid starting with another hardware. Thanks a lot!
391P

### German Version ###

Hallo ihr zwei und vielen Dank für die Rückmeldung.

@EDB: In der Arduino Community wurde das Vorgehen, die Umsetzung und die Nutzung bereits überprüft. Mit einem positiven Ergebnis. Hier wurde ich gebeten, mich an den Hersteller zu wenden. Der Hersteller hat mich auf dieses Forum verwiesen?

Es scheint ein spezifisches Condor Problem zu sein, den alle anderen Simulatoren (FS 2004, FS X, IL2, Sailors of the Sky, FlightGear) erkennen den Arduino Joystick. Auf die Gefahr, dass ich mich wiederhole - Der Support war mal gegeben! Vielleicht ist es möglich diesen wieder herzustellen?

Ich bin gerne bereit als Proband hier zu unterstützen.

@EDB: Ich habe deinen Beitrag aus dem letzten Jahr gefunden. Gab es hierzu eine vollständige Lösung? Gibt es jemanden, der das Problem in den Griff bekommen hat ohne zusätzliche Software sondern Plug and Play mit einem Arduino? viewtopic.php?f=31&t=18309

Gibt es eine Anleitung, wie ich Condor die Einstellungen vorgeben kann? Vielleicht über die Controller.ini - Leider verstehe ich das vorgehen aus deinem Beitrag hier nicht ganz!

@BeatFromTheEast: Ich denke diese Variante wird weiterhin mein Plan B sein. Welche Komponenten benötige ich den dafür, wenn ich mit Potentiometer und Knöpfen an dem Leo Bodnar Board arbeiten möchte? Ich verstehe deinen Beitrag nicht ganz und würde mich über ein paar mehr Details via PM freuen. Vielen Dank.

Würde mich freuen von Mitgliedern zu hören, die eine Arduino Lösung bereits im Einsatz haben und mich unterstützen könnten. Dafür habe ich schon ausreichend Zeit in das Thema gesteckt, um nicht wieder mit einer anderen Hardware zu starten. Danke!
391P

User avatar
EDB
Posts: 1575
Joined: Mon Oct 31, 2011 1:17 am
Location: The Netherlands, Europe Continent, Earth Planet, Milky Way Galaxy, Virgo Super Cluster

Re: Problem with Arduino Joystick -Help!

Post by EDB » Wed Jul 24, 2019 12:50 pm

About the other topic. Please ask the topic starter.

About calibration. This is how a correctly calibrated stick will look like.
Image
Try to turn off the button 3 when assigning controls in Condor.
BTW. You never showed us how your assignment in Condor looks like right now. Assigned for an other stick?

Maybe also check your calibration with DIView ; http://www.leobodnar.com/products/BU0836/DIView.zip

I did look through your code... It looks really messy considering spaces....
And are you sure you have to set your resolution to 1024 (0-1023) and not 256 (0-255)..? Or 2048...

Maybe try to remove all the USB history in Windows.

I don't think I can help you any further...

391P
Posts: 8
Joined: Tue Jul 16, 2019 9:15 pm
Location: Hannover, Germany

Re: Problem with Arduino Joystick -Help!

Post by 391P » Wed Jul 24, 2019 1:34 pm

### English Version ###

Hello, EDB.

I will get in touch with the other member of the forum during the day - Maybe he found a solution and just didn't publish it! You never know...

The screenshot at the beginning of this topic should only illustrate that the axes and buttons are functional. As you can see here also my Arduino joystick is calibrated correctly and recognized by Windows 7 / 10. The Arduino Joystick can already be used, but it is not recognized by the Condor Simulator!

Image

The code was created by the demo code of the used library. I only used the empty spaces to be able to read the code better. The code is functional and tested by the Arduino community! The mentioned resolution of 1024 is used and recommended in version 2.0.5 of the library - I will try with the lower values. Thanks for the tip!

Uninstalling all USB devices is not necessary, because I only bought a notebook for the simulator, where only the Arduino was installed as a hardware component.

Is there a minimal request what the Condor needs in data? In the other topic we talked about a minimal value of 90%. I should have reached him, shouldn't I?
If in the windows joystick test/calibration app you can not achieve almost maximum deflection, condor setup will not assign the stick/axis. The movement needs to exceed ~90% of the maximum range before its being picked up.

If you can not change this range in the firmware of your stick, you should be able to assign the controller manually by editing controls.ini
C:\Users\yourname\Documents\Condor\Pilots\yourpilot
Thanks for your input. I think we still come to a result!
391P

### German Version ###

Hallo EDB.

Ich werde mich im Laufe des Tages bei dem anderen Mitglied des Forum melden - Vielleicht hat er ja eine Lösung gefunden und sie nur nicht veröffentlicht! Man weiß ja nie...

Der Screenshot zu Beginn dieses Themas sollte nur veranschaulichen, dass die Achen und Knöpfe funktionsfähig sind. Wie du hier sehen kannst ist auch mein Arduino Joystick vollkommen korrekt kalibriert und von Windows 7 / 10 erkannt. Verwendet werden kann der Arduino Joystick bereits, nur wird er nicht vom Condor Simulator erkannt!

Image

Der Code ist entstanden durch den Demo-Code der verwendeten Library. Ich habe lediglich die Leerräume verwendet, um den Code besser lesen zu können. Funktionsfähig und Arduino-Community geprüft ist der Code! Die angesprochene Auflösung von 1024 wird in der Version 2.0.5 der Library verwendet und empfohlen - Ich werde es mit den niedrigeren Werten versuchen. Danke für den Tipp!

Das deinstallieren aller USB-Geräte ist nicht notwendig, da ich nur für den Simulator ein eigenes Notebook gekauft habe, wo bisher nur der Arduino als Hardware Komponente installiert wurde.

Gibt es eine Minimal-Anforderung was der Condor an Daten benötigt? In dem anderen Thema wurde von einem Minimalen Wert von 90% gesprochen. Den sollte ich doch erreicht haben, oder?
Wenn Sie in der Windows Joystick-Test-/Kalibrier-Applikation keine fast maximale Auslenkung erreichen können, wird das Kondor-Setup den Stick/Achse nicht zuordnen. Die Bewegung muss ~90% des maximalen Bereichs überschreiten, bevor sie aufgenommen wird.

Wenn Sie diesen Bereich in der Firmware Ihres Sticks nicht ändern können, sollten Sie den Controller manuell zuweisen können, indem Sie controls.ini bearbeiten.
C:\Benutzer\Ihr Name\Dokumente\Condor\Piloten\Ihr Piloten\Ihr Pilot
Danke für deinen Input. Ich denke wir kommen noch zu einem Ergebnis!
391P

User avatar
EDB
Posts: 1575
Joined: Mon Oct 31, 2011 1:17 am
Location: The Netherlands, Europe Continent, Earth Planet, Milky Way Galaxy, Virgo Super Cluster

Re: Problem with Arduino Joystick -Help!

Post by EDB » Wed Jul 24, 2019 4:08 pm

One last thing you can try is to make another pilot in Condor. Maybe files in your current pilot profile are corrupted...

Condor only needs a correctly calibrated Windows compatible joystick... Nothing more...

User avatar
BeastFromTheEast
Posts: 445
Joined: Fri Dec 14, 2012 12:21 am
Location: Ipswich, Suffolk

Re: Problem with Arduino Joystick -Help!

Post by BeastFromTheEast » Tue Aug 13, 2019 11:49 pm

391P wrote:
Wed Jul 24, 2019 9:30 am
@BeatFromTheEast: I think this variant will still be my plan B.

Which components do I need if I want to work with potentiometers and buttons on the Leo Bodnar Board? I don't fully understand your contribution and would appreciate some more details via PM. Thank you very much.
This is a link to the Bodnar 0836 board.
http://www.leobodnar.com/shop/index.php ... f617b09b08
It should answer most of your questions, but it is basically designed to be interfaced directly with potentiometers / buttons with a minimum of additional electronics. The pin spacings are standard 0.1" so you can plug in servo extension leads directly and wire them straight to the potentiometers.

The only thing which is a little complex is that to access all 36 "buttons" the 36 physical buttons need to be wired in a 6X6 matrix using an additional diode.

In my cockpit the board is wired to the PICAXE20X2 microcontroller via 36 opto isolators (which are connected across the 6X6 matrix) and 8 analogue signal converters, which give the board all its inputs.
016 cropped.jpg
The controls are resolved using IMUs (motion sensing circuit boards) and the numbers crunched using a maths co-processor - there isn't a single potentiometer in the whole of the rig.
024 small.jpg
Ian
You do not have the required permissions to view the files attached to this post.
You can take the Beast from the East
But never the East from the Beast
Image
Beastly Soaring - Tuesday nights, on the ServerOfTheBeast
Competition number IFC, aircraft registration number G-CHQR

awebb
Posts: 98
Joined: Thu Sep 14, 2006 7:11 pm

Re: Problem with Arduino Joystick -Help!

Post by awebb » Fri May 08, 2020 1:44 pm

@391P, did you find a solution to this? I'm having the same problem with a Duino Pro Micro... It works everywhere else, but I can't map buttons in Condor. I've even tried some very simple (one button) controllers with no luck.

Thanks

AW

391P
Posts: 8
Joined: Tue Jul 16, 2019 9:15 pm
Location: Hannover, Germany

Re: Problem with Arduino Joystick -Help!

Post by 391P » Sun Jul 05, 2020 2:12 pm

### English Version ###

Hello, everyone.

Actually I found what I was looking for and solved the problem!
Unfortunately, I don't have the time to show everything in detail with screenshots and some more information here.

The short version:
I only supplied my joystick with the inputs that actually had a real sensor "at the other end" of the PC at the current stage of development. My programming provided that I use the normal rudders and include X-additional switches, as well as potentiometers for airbrakes and flaps. So as soon as I had only considered the minimum set of sensors :!: in the joystick, everything else was no problem! My Arduino joystick is recognized immediately and I can make the assignment in Condor (although Condor already does this automatically). Only the switches (e.g. chassis) must be assigned manually.

I hope that I could help you further. I will gladly write here in more detail when I have the time and I have found the screenshots again. If you have any further questions, please contact me.

### German Version ###

Hallo zusammen.

Tatsächlich bin ich fündig geworden und habe das Problem gelöst!
Leider fehlt mir gerade die Zeit, um mit Screenshots und einigen weiteren Informationen hier alles detailliert aufzuführen.

Die Kurzfassung:
Ich habe meinen Joystick nur mit den Inputs versorgt, die tatsächlich zum aktuellen Entwicklungsstand einen echten Sensor "am anderen Ende" des PCs hatten. Meine Programmierung hat vorgesehen, dass ich nehmen den normalen Rudern noch X-weitere Schalter einbinde, sowie Potentiometer für Bremsklappen und Flaps. Sobald ich also nur das Mindestset an Sensoren :!: im Joystick berücksichtig hatte, war alles andere kein Problem mehr! Mein Arduino Joystick wird sofort erkannt und ich kann in Condor die Zuweisung machen (wobei Condor dies bereits automatisch macht). Lediglich die Schalter (z.B. Fahrwerk) muss manuell zugewiesen werden.

Ich hoffe, dass ich weiterhelfen konnte. Gerne schreibe ich hier nochmal genauer, wenn ich die Zeit dazu habe und ich die Screenshots wiedergefunden habe. Wenn weitere Fragen aufgekommen sind, meldet Euch gerne.

skyracer
Posts: 2
Joined: Fri Oct 09, 2009 11:52 am

Re: Problem with Arduino Joystick -Help!

Post by skyracer » Thu Sep 24, 2020 10:58 pm

Hi 391P,

I just hit the same problem as you but I wasn´t able to follow your solution.

However, I found another solution elsewhere and I thought I will share my solution. I use an Arduino Mirco, with 4 Hall sensors, 9 buttons, no hat swtiches using the same Library as you (https://github.com/MHeironimus/ArduinoJoystickLibrary) in Condor 1.15. I will upgrade to Condor 2 as the joystick now is working. This is my code:

#include <Joystick.h>

Joystick_ Joystick(0x03, //hid report id
JOYSTICK_TYPE_GAMEPAD, //joystick type
9, //button count
0, //Hsw 0-2
true, //x
true, //y
true, //z
false, //rx
false, //ry
false, //rz
false, //rudder
true, //throttle
false, //accelerator
false, //brake
false); //steering

void setup()
{
Joystick.begin();
}

void loop()
{
Joystick.setXAxis(analogRead(A1));
Joystick.setYAxis(1024-(analogRead(A2))); // The input is reversed due to mounting of the sensor
Joystick.setZAxis(1024-(analogRead(A3))); // The input is reversed due to mounting of the sensor
Joystick.setThrottle(1024-analogRead(A4)); // The input is reversed due to mounting of the sensor
delay(5);
}

AstirAl
Posts: 9
Joined: Sun Jul 26, 2020 8:47 pm

Re: Problem with Arduino Joystick -Help!

Post by AstirAl » Thu Dec 31, 2020 5:35 pm

I had the exact same problem: My home made controller is based on an Arduino Pro Micro and the Joystick library with code very similar to Skyracer's example above. It appears as a game controller in the Windows 10 control panel and "just works" in Microsoft Flight Simulator. However, Condor 2 does not detect it at all.

The solution, which I found in a German-language blog post, was to install vJoy and Joystick Gremlin.
  • vJoy is a Windows device driver that creates a "virtual" joystick.
  • Joystick Gremlin maps the buttons on any number of real game controllers to outputs on the virtual joystick. I set up a mapping for each button and axis on the Arduino.
Condor detects the virtual joystick straight away and allows the controls to be assigned in the usual manner.

Caveat: On my PC the vJoy installer got to 100% progress and then froze. After 10 minutes I gave up waiting, killed it with Task Manager and rebooted. It works anyway.

AstirAl
Posts: 9
Joined: Sun Jul 26, 2020 8:47 pm

Re: Problem with Arduino Joystick -Help!

Post by AstirAl » Mon Jan 03, 2022 11:11 pm

More than a year later, I have a better solution which doesn't require vJoy.

As shown in the earlier posts, the key is to pass the correct parameters to the Joystick constructor. My mistake was to use the default, which declares more buttons and axes than Condor can handle.

Don't do this:

Code: Select all

Joystick _joystick;
Instead do something like this, specifying only the buttons and axes that really exist on your controller:

Code: Select all

Joystick_ Joystick(
  0x03, // HID report ID
  JOYSTICK_TYPE_MULTI_AXIS,
  13, // Number of buttons
  0, // Number of hat switches
  true, // X axis
  true, //Y axis
  true, // Z axis
  true, // X rotation
  false, // Y rotation
  false, // Z rotation
  false, // Rudder
  true, // Throttle
  false, // Accelerator pedal
  false, // Brake pedal
  false // Steering wheel
);

Post Reply