I am about to buy my first Arudino to use in my DJ controller project. Until now I've used two gamepad PCB for the brain. The signals from the gamepads is converted to MIDI with a HID-to-MIDI application.
But I want to exchange the gamepad PCB to a Arduino and make it a MIDIuno, or a HIDuino
So my first beginner questions is:
Is it possible to have 8 analog inputs (for faders/knobs), and 38 digital inputs (for regular buttons) from 1 pcs of Arduino UNO?
Or do I need a UNO + some extra card?
I'm a beginner to Arduino and electronics, but I now a little bit
Yes an extra card or to be more precise extra components. These are called port expanders. You can use the shift in technique:- http://www.arduino.cc/en/Tutorial/ShiftIn
No Arduino has 6 analog inputs and these are multiplexed , so there is only one ADC that is used by all analog pins. 38 inputs is also too much for an UNO (don't know the number of a MEGA)
Shields can solve a lot - google for centipede shield and you have 64 digital I/O lines.
What does "so there is only one ADC that is used by all analog pins" mean?
The chip can only read one analogue IP at a time because there is only a single ADC (A to D converter). You get 6 analogue IPs because there's a 6-way switch between the pins and the ADC. For most applications it makes no difference and it's all hidden by the Arduino environment.
Okey... So when I turn two knobs, only ONE works? Is this the same for the Mega? Sounds really limited?!
Literally this is true, a microprocessor can only ever do one thing at a time, but in practice it's not because things are happening at very fast speeds so it looks like it's all happening at the same time. So don't worry about that, it will work as you expect, turn a knob and the servo will follow, turn two knobs at once and both servos will follow their respective knobs (given the right software of course).
Just to confirm, can I have 8 analog inputs, and 38 digital inputs in one device with the Mega?
The docs state 54 IO pins, so 54 - 8 analogue = 46 left. So yes you will be OK.
I have searched for code that
can send these gamepad signals in arduino.
But I have not find any.
Can someone please show me a complete code for an arduino with one button that sends HID/gamepad-signals to Mac. Both digital and analog. Please? Just to give me a first direction.