Jump to content

an Arduino USB HID controller, composite USB controller


overpro

Recommended Posts

Sokol, thanks for the URL! My friend is soldering all the connections right about now so we'll see how it ends! Now we have enough options to make the 3position switch work!

 

Sacarino, I've sended your connection matrix to my friend so he can check it out and if everything goes well, it will help him out. Thanks for your time doing it!!

 

I hope that next week we'll have the first of two working, so I'll send you some photos of the button box finished!

 

Really appreciate your help guys!

Link to comment
Share on other sites

  • 2 weeks later...

Hi. I want to make an UFC for the F-18 compatible with F-16, Harrier and A-10 too. The firmware of Overpro is perfect for me. 4 pots goes well, 4 rotary encoders too, and I have plenty of room for buttons and switches. On a protoboard by now, everything is OK.

 

 

But I am thinking of putting some leds that turn on or off when I press a button or switch. For example, i would like to put three RGB leds that goes red or green with the status of the landing gear. Where should I connect the leds in my Arduino 2560 and how can I modify the software to add this function? With a switch on-off in the row of ON-OFF-ON, it would be as easy as to say "if switch is up (on1) turn the lights red, if the switch is down (off position) turn the lights green. Just for one determined switch. Anyone can show me an example?

 

 

Thank you

Link to comment
Share on other sites

  • 1 month later...

Hi Ferenc

 

What you ask is a bit complicated.

You should fist determine witch button on the Arduino would be the Gear up and down, as well as "opening" a few more buttons other than the ones for the joystick as input or output in the board. Then, from the switch itself, from their connectors, you would need a wire for the "joy part of the Arduino" and another wire that goes to the other buttons you opened.

Beside this, in the Arduino sketch/code you shoul add a few lines to establish that, for example, when button 5 is HIGHT, button 7, 8, 9 (output for the RGB) are xxx, yyy, zzz (the values for the RGB code to be a specific colour), and when button 5 is LOW, buttons 7, 8, 9 are another set of values for a different colour. It's been a long time since I did my last "programing" in Arduino code, and I was BAD at it, believe me, but I did some trials on that and had good results. I'll try to find that code I did and try to post it here. Give me a few weeks (busy right now).

Cheers, Saca111

Link to comment
Share on other sites

Hi. I want to make an UFC for the F-18 compatible with F-16, Harrier and A-10 too. The firmware of Overpro is perfect for me. 4 pots goes well, 4 rotary encoders too, and I have plenty of room for buttons and switches. On a protoboard by now, everything is OK.

 

 

But I am thinking of putting some leds that turn on or off when I press a button or switch. For example, i would like to put three RGB leds that goes red or green with the status of the landing gear. Where should I connect the leds in my Arduino 2560 and how can I modify the software to add this function? With a switch on-off in the row of ON-OFF-ON, it would be as easy as to say "if switch is up (on1) turn the lights red, if the switch is down (off position) turn the lights green. Just for one determined switch. Anyone can show me an example?

 

 

Thank you

Here I made an example that should work for a Gear up/down light

115297607_GearLED.png.610b15fd00f536c8d0c40750d6469f26.png

Link to comment
Share on other sites

Hm... Why are you not using a 2pole switch?

 

Example for ON-ON 2pol.:

10a-switch-dpdt-on-on-screw-terminals.jpg

 

Left side: controlling LEDs

Right side: Arduino -> DCS

 

As you won't get any output from the sim which you can control with the Arduino, you can only switch the LEDs on/off directly.

 

ON-OFF-ON could be used as well, if you want to have a neutral middle position.

 

Or are you aiming for another solution?

Link to comment
Share on other sites

  • 1 month later...
Hm... Why are you not using a 2pole switch?

 

Example for ON-ON 2pol.:

10a-switch-dpdt-on-on-screw-terminals.jpg

 

Left side: controlling LEDs

Right side: Arduino -> DCS

 

As you won't get any output from the sim which you can control with the Arduino, you can only switch the LEDs on/off directly.

 

ON-OFF-ON could be used as well, if you want to have a neutral middle position.

 

Or are you aiming for another solution?

 

I am using an ON-OFF switch. Mi idea is ON = gear down, OFF= gear up. The lights should be green in the on position and red in the off. Really, I want to put 2 different lights, like in some russian planes. One light green (gear down) would be below the switch and one red light (gear up) above. But I think I have the concept. I'll make some tests. Today I've received the switches, leds and buttons.

 

Thank you for your help

Link to comment
Share on other sites

  • 2 months later...
On 10/30/2020 at 4:20 PM, waqarshk said:

Hi everyone, can anyone guide how to use a 4x4 keyboard with this code.

Hi.

   If the keyboard is matrix type, I mean a 2X2, with only 4 connectors, you shold do the following:

2 of the connections are for "rows" and the other two are for "columns". Find them wit a continuity tester, and then conect both  rows to two pin n 26 and 27, the column ones to column pins 40 an 41. Now all 4 buttons should lit up when pressed.

   If the keyb is non matrix, with 5 connectors (1 ground and 4 "buttons"), again, find the ground one and connect it to pin 28, and the other 4 connect them to pins 38, 39, 40, 41. This should do the trick.

   I may ahve misnumbered the pins, as I am texting without an Mega at hand, but if the pin number is incorrect, just select the latest ones for each row and column.

Saludos.

Saca111

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...
On 7/20/2021 at 1:04 PM, glynd02 said:

Thanks No1sonuk - will give this a try and see if it works...

 

Cheers

Hi.

Same here. Can't compile the .hex, with the name changed or not, doesn't matter. About this video, I am affraid that the mega uses a different microchip, so I don t think that trick will do.

Would be really great is some programming wizzard that live around would compile some .hex with different names on them, like CVP1joystik, CVP 2Joy or  similar...

Saludos.

Saca111

Link to comment
Share on other sites

  • 2 years later...
I would like to add 8 additional axles.
I added in descriptor.c in Joystick2Report

/* 8 axes, signed 16 bit resolution, the actualy resolution is still 10 bit range 0~65535 */
0xa1, 0x00, /* Collection (Physical) */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x30, /* Usage (X) */
0x09, 0x31, /* Usage (Y) */
0x09, 0x32, /* Usage (Analog1) */
0x09, 0x33, /* Usage (Analog2) */
0x09, 0x34, /* Usage (Analog3) */
0x09, 0x35, /* Usage (Analog4) */
0x09, 0x36, /* Usage (Analog5) */
0x09, 0x37, /* Usage (Analog6) */
0x27, 0xff, 0xff, 0x00, 0x00, /* Logical Maximum (65535) */
0x47, 0xff, 0xff, 0x00, 0x00, /* Physical Maximum (65535) */
0x75, 16, /* Report Size (16) */
0x95, 8, /* Report Count (8) */
0x81, 0x82, /* Input (Data, Variable, Absolute, Volatile) */
0xc0, /* End Collection */

in Arduino-joystick.h int16_t axis[8] in USB_Joystick2Report_Data_t;

typedef struct {
int16_t axis[8];
#if HID_INTERFACENUMBER == 1
uint8_t button[32]; // each byte represent 8 button state
#else
uint8_t button[16]; // each byte represent 8 button state
#endif
} USB_Joystick1Report_Data_t;

typedef struct {
int16_t axis[8];
uint8_t button[16]; // each byte represent 8 button state
} USB_Joystick2Report_Data_t;

in CVP_JoystickController.ino I changed from
#define NUM_AXES 8
to
#define NUM_AXES 16

the computer sees the addition of these axes but they stay in place and I can't use them.
Could someone help me and tell me what else I need to change to activate all 16 axes?
I've been looking for a solution for 2 weeks but I can't find it

Thank you in advance.
Edited by cristiano199
Link to comment
Share on other sites

I remember once that I had two virtual controllers made from one Arduino and 6 axes in each. Windows saw them and they all worked.
There are 2 virtual devices here and one has 8 axes and 128 buttons in the second one, 128 buttons without axes.
Are you sure I can't add these additional 8 axes to the second device?
Maybe I should change something else in the library because Windows physically sees them, but they do not respond to changes on the potentiometer.
Edited by cristiano199
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...