Is there any way to connect 2 arduino micro's together, so that i only have to plug 1 into my pc?

I am pretty new to arduinos and programming, and i have decided to challenge myself with a project. Im trying to build a F-16 joystick, and it has too many 5- way switches for 1 micro, so i need to use 2. i dont want to hook up 2 USB cables everytime i want to use it, so is there a way to send the input of a button through an arduino, or make windows recognize 2 arduino micros whilst having only 1 connected via USB cable?

Thanks in advance!

Not that I know of. You could use a USB hub then you only would have one wire to your PC.

Welcome to the forum. You don't mention which Arduino board you are planning to use. How many pins does your project require? The GIGA R1 WiFi provides 76 digital I/O pins.

There are many schemes for communicating between 2 Arduinos, such as serial, i2c, WiFI, BLE, etc.

The project task you set for yourself is non-trivial. I would suggest breaking it down into smaller pieces, such as getting the code for a limited number of 5-way switches working. Then, decide how you wish to do inter-board communication. Prototype that and then integrate both switch control and communications.

Yes, but the problem starts with the design of the three programs and their communications protocol and message formats. The program on each of the Arduino micros would be entirely different because one will have to determine from the message contents where the message was to go. Either to the 2nd Arduino or to the PC or the process the message on the current Arduino.
Then the problem becomes designing and writing a program for the PC to get data from a keyboard and possible send it to the connected PC.
ALL THIS NEEDS TO BE DESIGNED before and program code can be started.

He did it:

1 Like

You could probably use shift registers for the switches then you would only need 3 pins, assuming you daisy chain them. Which in turn would mean you only need one micro instead of two. There are also IO expanders like the MCP23017 Port Expander library, for the MCP23017 ic that Adafruit sells here

1 Like

Windows easily recognizes Arduinos when on separate USB connections. Also a separate window for each if you want. But requires a separate wire for each.

This is your mistake. It's not true, and your conclusion is wrong.

Did you ever take apart an old PC USB keyboard? These have 100+ keys. But you will not find a chip with 100+ input pins on the keyboard's PCB.

1 Like

Thanks for the idea! If i really dont find a solution for my problem, this will be my go-to method.

So what you are saying is that there is a way to fit all those single connections onto a single micro?

Yes, if you design and program all the necessary software. That might take a year or so to complete.

I am saying there might be.

I will need more details of your circuit before I can say for sure.

You must list all the buttons and other controls you want to use, how many of each, and give links to the tech details of each type.

Is this similar to your joystick?

If so, I see 4x 4-way controls and another 4 or 5 simple buttons. This will require 9 or 10 Arduino pins.

Plus 2 (or 3?) analog inputs for the joystick movement.

Im using 2 micros. The stick will require a total of 24 connections, 22 of them being digital and 2 analog for the y/x axis. the 5 way switches behave like normal buttons, and the code for them ive already got up and working.

yes, this is exactly what im going for. The grip itself and button hats are 3d printed, with holes where the 5 way switches are mounted, and so for the simple buttons. this should show where the buttons are being placed. the joystick movement uses 2 analog inputs.
So in total :
4 5-way switches
5 simple buttons ( i forgot the paddle switch in the photo, but it counts as a simple button)
2 potentiometers for the x/y axis

Yup, 10 pins should do it, plus 2 analog pins. No need for multiple Micros!

I think you understood me wrong, each 5- way switch needs 4 conections + GND, since each pin leg behaves like a singular button. here is a picture of the 5-way switches i am currently using.

I think each 5-way switch has 5 connections + a common pin.

4x 5-way switches + 5 pushbuttons. 10 Arduino pins. May also need a few diodes.

Please explain what I misunderstood.

1 Like

Can you draw a schematic of what you want to make? Hand drawn is fine.

I found this link HERE in an older forum post back in 2020, it looks like the same switch.

I am guessing PaulRB is figuring to use the something like the Keypad library or the actual Keypad library to handle the 5-way switches. And if so that will be a 4x5 layout which will take up 9 pins for just the switches and another 1x5 for the push buttons which if combined with the switches will be a 5x5 layout and thus 10 pins like PaulRB said.

Sorry, i think that i understood PaulRB wrong. I have heard of the keypad library but i didnt think that it could be used for a case like mine. How could i impliment it into my code? And what do you both mean by the "1x5" and "4x5" layouts?

you might have to do a SMART USB hub, it tells the computer all the components connected, but it may be expensive depending where you get it.