Hello,
This is my first project so I apologize for my nobby questions.
I'm currently at the step of buying components.
Right now I have:
1 Leonardo
8 buttons with 12V LED (8 switches)
1 8-way joystick with 12V LED (4 switches)
1 12V power supply
some cables + connectors
So my project consists of lighting the LEDs with the PC "game" and react to the button presses.
I would like to make something similar to the "reaction games" that you can find in some arcades where you need to hit the button that lights up. Like whack-a-mole but with LEDs.
There are 20 I/O on the Leonardo. I was thinking to use 8 for the buttons, 8 for the button LEDs and 4 for the joystick (no space for the joystick LED
)
So my questions are more related on how to wire this up. I have no experience doing something like this.
First, my LEDs are specified as 12V, so I should probably use the power supply to power them. What are the downsides of not using the power supply, or plugging the power supply to the Leonardo instead of using it as an external power supply?
If I understand correctly I would need 1 Mosfet for each LED to control it using digital I/O while feeding it the 12V. Could someone recommend what mosfet to use?
How would I connect all the LEDs to the same power supply but with different I/Os? I have only found examples with 1 LED strip, 1 mosfet, and 1 12V power supply, not more.
Next, I saw that most projects with LEDs have resistors. How do I choose the correct resistor and where should I connect them?
Finally, I want to control the LEDs from the PC "game" how would that work. I would make it using the game engine Unity. Is there a way to control the Leonardo I/O from the PC, if so how?
Is it recommended to get a breadboard for prototyping? My main concern is how I am supposed to wire everything up since I kind of forgot all my analog electronics knowledge (which was never brilliant). I think I can figure out the programming stuff, somehow.
Thank you for your time, I look forward to your replies.