Page 1 of 1

Arduino Nano instead of Teensy?

Posted: Thu Sep 07, 2017 12:37 pm
by Fredl
Hello maybe this belongs in software....

I bought 3 Arduino Nano clones, thinking they could do the exact same thing as a Teensy. (Yes, I'm a cheap idiot :D )

Now that I look into the matter, I read all across the net, that they can not (easily) emulate USB HID devices.

My plan is to simply read out a single 2 axis joystick with the Nano and connect it to the Pi which is runnning RecalBox.

Anyone who has already achieved this and/or knows if it is possible?

Re: Arduino Nano instead of Teensy?

Posted: Thu Sep 07, 2017 1:50 pm
by Fredl
Ok I did some further research and it doesn't look too promising.

I decided to buy 2 Arduino Micro Pros, as they can seem to do the trick.

(I bet I'll buy 2 Teensies in the end anyway :D )

Re: Arduino Nano instead of Teensy?

Posted: Thu Sep 07, 2017 2:06 pm
by abrugsch
Are the micro pros atmega 328p? If so they are not good for being usb hid devices. 32u4 mcu's as used in a leonardo work well (it's what is used in helder's and kite's aio boards. Or you could just connect your buttons direct to GPIO pins...

Re: Arduino Nano instead of Teensy?

Posted: Thu Sep 07, 2017 2:15 pm
by Fredl
Yeah that's what I read.
abrugsch wrote:
Thu Sep 07, 2017 2:06 pm
Or you could just connect your buttons direct to GPIO pins...
I'm planning on doing both. The 1up kit I'm building is using the GPIO pins for buttons. There's a "joystick" as well in the kit, but I found out its just triggering the dpad as well and the haptic feel of it is truly terrible!

So I tried to give the project my personal touch and add the joystick via microcontroller. (I hope using both GPIO and microcontroller at once for player 1 won't be an issue in RecalBox...)

Anyways, the Pro Micros I just ordered are built around the 32u4, so I'll try my luck with them!

Re: Arduino Nano instead of Teensy?

Posted: Fri Sep 15, 2017 3:54 pm
by doro44
dude, forget teensy. Use GPIO instead. Its pretty straight forward.

Re: Arduino Nano instead of Teensy?

Posted: Sat Sep 16, 2017 12:33 pm
by Fredl
doro44 wrote:
Fri Sep 15, 2017 3:54 pm
dude, forget teensy. Use GPIO instead. Its pretty straight forward.
Yes, yes like I said: I'm using the GPIOs for the buttons already. However, the Raspberry doesn't sport a ADC, so connecting a joystick (which does anything other than on/off) isn't possible without a teensy or the likes.

Btw, I tested the Sparkfun Pro Micro clones and they seem to do their job really well! (Although one board came dead...) So anyone who want's to cheap out on teensies, use these! :-)

Re: Arduino Nano instead of Teensy?

Posted: Mon Sep 18, 2017 12:43 pm
by doro44
Fredl wrote:
Sat Sep 16, 2017 12:33 pm
doro44 wrote:
Fri Sep 15, 2017 3:54 pm
dude, forget teensy. Use GPIO instead. Its pretty straight forward.
Yes, yes like I said: I'm using the GPIOs for the buttons already. However, the Raspberry doesn't sport a ADC, so connecting a joystick (which does anything other than on/off) isn't possible without a teensy or the likes.

Btw, I tested the Sparkfun Pro Micro clones and they seem to do their job really well! (Although one board came dead...) So anyone who want's to cheap out on teensies, use these! :-)
Whats ADC buddy?

Re: Arduino Nano instead of Teensy?

Posted: Mon Sep 18, 2017 12:50 pm
by Fredl
doro44 wrote:
Mon Sep 18, 2017 12:43 pm
Whats ADC buddy?
Analog to Digital Converter. The GPIOs of the Pi can measure high and low - on and off, perfect for buttons. But an analog joystic outputs a variable voltage, which you need to measure.
And that's what an ADC does - it converts a voltage between GND and VCC to a digital value between 0 and 1023 (for a 10bit ADC).