[NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Various user-contributed guides for hardware-related things
User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by goosewerks » Wed Nov 22, 2017 6:52 am

salami738 wrote:
Tue Nov 21, 2017 11:37 pm
Baconbomb80 wrote:
Tue Nov 21, 2017 6:36 am
goosewerks wrote:
Thu Oct 19, 2017 9:21 am
Fun Fact: If you accidentally bought the 3.3v/8mHz version, the button presses work with NO lag at all, but the analog sticks will NOT work. I was arguing with mine for a solid week and realized I bought the wrong version. Hupps. I'd done this exact guide before on two Arduinos and it's worked perfectly, but y'know, I bought the right hardware that time.. Double check your stuff, pls don't be a goober like me.

Another round of thanks for this guide!
How do you know it's the wrong one? There is no marking on the board and im having issues with my analog sticks. I don't get full motion and there is a lot of jitter when not touching the stick.
According to sparkfun (https://www.sparkfun.com/products/12640, https://cdn.sparkfun.com/datasheets/Dev ... o_v13b.pdf) the connector SJ1 has to be open on 3,3V boards, and closed on 5,0V boards. BUT: The china boards have an open SJ1 and 16 MHz, so please check the chrystal instead.

Alternatively, you can check the chrystal on the board (the shiny thing on the bottom). If it has a label "16.000" you have a 16 MHz board.
This. Also, they're cheap enough on Aliexpress / eBay / Amazon that you can just buy more and try again.

Crashdummy
Posts: 12
Joined: Wed Dec 06, 2017 5:10 am
Has thanked: 1 time
Been thanked: 2 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Crashdummy » Wed Dec 06, 2017 5:36 am

Hey There :)
I am following this Guide Point-by-Point.
I have the Following Setting:
13 x Buttons (from 0 to 16 ( Left out 8 ))
1 x PSP1000 ( A0 (up/down) and A2 (left/right) )

The Buttons are Working like they should but the PSP-Stick doesn't.
It only Recognizes One Axis ( changing A0 and A2 in the Code Changes the Axis ).
Now When I move the Stick the Values for Both axis are changing.

Meaning: When I push the stick upwards for example, I get xAxis --> 1 AND yAxis --> 1 ( Topleft in Windows Devicethingy) when I push it downards --> -1 AND -1 (Bottom Right )

Did someone maybe has the same Problems?

User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by goosewerks » Sat Dec 09, 2017 4:15 pm

I had to us A2 and A3 to get it to work.

Crashdummy
Posts: 12
Joined: Wed Dec 06, 2017 5:10 am
Has thanked: 1 time
Been thanked: 2 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Crashdummy » Tue Dec 12, 2017 12:13 am

goosewerks wrote:
Sat Dec 09, 2017 4:15 pm
I had to us A2 and A3 to get it to work.
Thanks for the reply :-)
I ended up using A1 and A2 as well,
but the main problem was the code itself ( I guess something with my PSP stick went wrong )
I ended up rewriting the code

Thesonofromeo
Posts: 23
Joined: Sat Aug 05, 2017 10:41 pm
Has thanked: 8 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Thesonofromeo » Sat Dec 30, 2017 1:00 pm

I keep killing the Leonardo pro micros. Any tips?

User avatar
goosewerks
Posts: 93
Joined: Mon May 22, 2017 8:27 am
Has thanked: 18 times
Been thanked: 39 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by goosewerks » Sat Dec 30, 2017 8:42 pm

Crashdummy wrote:
Tue Dec 12, 2017 12:13 am
goosewerks wrote:
Sat Dec 09, 2017 4:15 pm
I had to us A2 and A3 to get it to work.
Thanks for the reply :-)
I ended up using A1 and A2 as well,
but the main problem was the code itself ( I guess something with my PSP stick went wrong )
I ended up rewriting the code
Can you post what you changed? Might help someone else!

Crashdummy
Posts: 12
Joined: Wed Dec 06, 2017 5:10 am
Has thanked: 1 time
Been thanked: 2 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Crashdummy » Mon Jan 01, 2018 11:52 pm

goosewerks wrote:
Sat Dec 30, 2017 8:42 pm
Crashdummy wrote:
Tue Dec 12, 2017 12:13 am
goosewerks wrote:
Sat Dec 09, 2017 4:15 pm
I had to us A2 and A3 to get it to work.
Thanks for the reply :-)
I ended up using A1 and A2 as well,
but the main problem was the code itself ( I guess something with my PSP stick went wrong )
I ended up rewriting the code
Can you post what you changed? Might help someone else!
I don't think it will be of any help. ( Really dirty fix )
I had to rewrite the code for my PSP Stick wasn't behaving like it should.
The Fix was merely to add an Offset to the Method Call and an increase of the Sticks Deadzone.

Thesonofromeo
Posts: 23
Joined: Sat Aug 05, 2017 10:41 pm
Has thanked: 8 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Thesonofromeo » Mon Jan 15, 2018 6:05 am

I need help. I keep getting double sometimes triple presses of any of my buttons and my analogue stick only registers the y axis

Crashdummy
Posts: 12
Joined: Wed Dec 06, 2017 5:10 am
Has thanked: 1 time
Been thanked: 2 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by Crashdummy » Tue Jan 23, 2018 8:34 am

Thesonofromeo wrote:
Mon Jan 15, 2018 6:05 am
I need help. I keep getting double sometimes triple presses of any of my buttons and my analogue stick only registers the y axis
Are you sure your soldering is good enough ?

As for double/tripple presses:
Regarding Softwareproblems you can either use another joystick-Library ( more difficult ), but the easier Method would be to add a Delay at the end of your Method.

Code: Select all

Delay(100); // This will add a 100ms ( 1/10 second ) Delay
As for your Analog Stick:
You should measure your InputRanges. Mine were different as well, so I couldn't use Sota' s Code ( Using his Code both my Axes got updated simultaneously ).
Afterwards you can add the difference as an Offset.

Code: Select all

 
  Joystick.setXAxis(map);
  Joystick.setYAxis(map);
  Joystick.setRxAxis(map);
  Joystick.setRyAxis(map);
  
This Part Returns the measured Values to your Pi.

User avatar
nobble
Posts: 20
Joined: Tue Feb 20, 2018 4:54 pm
Has thanked: 10 times
Been thanked: 17 times

Re: [NEW VERSION] Sota's 14 buttons + optional up to 2 analog sticks guide for a Leonardo Pro Micro (Teensy alternative)

Post by nobble » Wed Mar 14, 2018 12:54 am

I'm trying to program a Pro Micro with Sota's code for dual joysticks. I bought the generic blue board version and added all the extra files needed, but it wont pick up in Arduino. If anyone has any direction, I would really appreciate it. I kept getting COM errors and the lovely 'JoyState_t' does not name a type Error. I'm on Arduino 1.0.5r2 like it says is needed..

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest