Author Topic: game controller build thread (PS Vita analog stick, Cherry Red, Leonardo, LoL)  (Read 75267 times)

0 Members and 1 Guest are viewing this topic.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
It's quite hard to get my head round how to actually make this, it's not even like you can make strips of switches for each position and stick them together as all the fingers are different sizes.  I think clay is a great choice as it doesn't harden anywhere near as quickly as the plastic and hot glue I'll be using, and you're very unlikely to burn yourself while I'd rate my chances 50/50 at best!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline 3K

  • Posts: 279
  • Location: Germany


So you basically controlled the cam with the left hand using a stick while at the same time aiming attacks with the mouse on the right? Does this work out of the box? I thought both inputs would be registered equally by the computer, making them overlap and not work this way?

3K,

I think i know what you mean about the overlapping.  But in practice, it brings about something wonderful.  Yes, when using arrow keys or a joystick to move the map, the pointer comes along for the ride. It does not get left behind in its position, but rather remains in its relative position on screen.  You can therefore place the pointer onto anything by only using camera control if you really wanted to.  Try it.  And yes, it is out of the box /w camera unlocked as anyone other than a 1st time player would choose.

Why is this helpful?  Something outstanding happens with the combo of joystick and mouse, which is a combination very similar to WASD and mouse control in an FPS.  One movement is the macro or large imprecise movement control while the other movement allows for the finer control. 

With this combo and league, you end up using the camera control continuously, which also moves the mouse pointer in an imprecise but non-laborious way, while making quick, purposeful, precise pointing commands with the mouse. The result is that you move the mouse pointer vastly less often and with much less travel distance than the conventional way of using the mouse without assisting its movement with any complementary movement. Another way to state this would be that you not only have continuous independent direct camera control, you also get a significant pointer control assist that takes something like 70% of the labor out of moving the mouse pointer because pointer control is essentially done with two hands instead of one.

The difference is night and day.  How big of a difference?  imagine playing an FPS without any WASD controls for walking, and you only had a mouse to control your reticule and could never strafe

This sounds really good and I would love to test this out! Unfortunately I do not own any device with joystick that works on my computer right now. I'll look into connecting my wireless XBOX360 controller.

I guess this is a strong argument for not missing out on a joystick on the device this thread one day will publish!

                   Model M '88    | Model M SSK '87 | HHKB P2  | Zowie FK1

Offline Camineet

  • Thread Starter
  • Posts: 287
It's quite hard to get my head round how to actually make this, it's not even like you can make strips of switches for each position and stick them together as all the fingers are different sizes.  I think clay is a great choice as it doesn't harden anywhere near as quickly as the plastic and hot glue I'll be using, and you're very unlikely to burn yourself while I'd rate my chances 50/50 at best!

I don't want to discourage new friends here from trying different approaches in constructing the housing for this thing, but I will tell you this.

In working with the Clay to get the basic shape, I have found a great deal of required fiddling about in order to get the right angles and shapes. I think that by starting with something that is not in direct contact with the hand such as drawings on a computer or any other such indirect and non-immediately and non-continuously malleable material will be met with small to significant differences in the shapes and angles needed.

I'm not sure if that makes sense, but what I'm trying to say is that you really need to get the basic shape down by putting something into your hand that can be adjusted or tailored right then and there. Going back and forth between hand and work desk while constructing something that requires some number of minutes just to make a tiny adjustment, as opposed to just pushing, poking, or squeezing for a half second to make the adjustment, seems to me to be prohibitively time-consuming and difficult.

It would also suck to burn yourself with hot glue xD

At any rate, like I said, I don't want to discourage anyone from different approaches.  Just hoping to share my experience thus far ;)

Offline Camineet

  • Thread Starter
  • Posts: 287


So you basically controlled the cam with the left hand using a stick while at the same time aiming attacks with the mouse on the right? Does this work out of the box? I thought both inputs would be registered equally by the computer, making them overlap and not work this way?

3K,

I think i know what you mean about the overlapping.  But in practice, it brings about something wonderful.  Yes, when using arrow keys or a joystick to move the map, the pointer comes along for the ride. It does not get left behind in its position, but rather remains in its relative position on screen.  You can therefore place the pointer onto anything by only using camera control if you really wanted to.  Try it.  And yes, it is out of the box /w camera unlocked as anyone other than a 1st time player would choose.

Why is this helpful?  Something outstanding happens with the combo of joystick and mouse, which is a combination very similar to WASD and mouse control in an FPS.  One movement is the macro or large imprecise movement control while the other movement allows for the finer control. 

With this combo and league, you end up using the camera control continuously, which also moves the mouse pointer in an imprecise but non-laborious way, while making quick, purposeful, precise pointing commands with the mouse. The result is that you move the mouse pointer vastly less often and with much less travel distance than the conventional way of using the mouse without assisting its movement with any complementary movement. Another way to state this would be that you not only have continuous independent direct camera control, you also get a significant pointer control assist that takes something like 70% of the labor out of moving the mouse pointer because pointer control is essentially done with two hands instead of one.

The difference is night and day.  How big of a difference?  imagine playing an FPS without any WASD controls for walking, and you only had a mouse to control your reticule and could never strafe

This sounds really good and I would love to test this out! Unfortunately I do not own any device with joystick that works on my computer right now. I'll look into connecting my wireless XBOX360 controller.

I guess this is a strong argument for not missing out on a joystick on the device this thread one day will publish!

You can actually try this right now very easily. Camera control in league is mapped to the arrow keys by default.

You can start a custom game, put your right hand on your mouse as usual, and then put your left hand on your arrow keys as if they were WASD.

Try going through the first five or 10 minutes of a bot game just laning like this, and I bet you'll be hooked :))

actually, if you're historically a console gamer, then you'll need to experience this /w a thumbstick one way or another, such as /w your 360 controller, to really see the magic.

but if you're historically a pc gamer /w pc fps experience using WASD, you should be able to see the magic immediately ;)
« Last Edit: Tue, 06 October 2015, 12:06:49 by Camineet »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
It would also suck to burn yourself with hot glue xD

Yes, it does!  I made a numberpad using nothing but keycaps and hot glue and had to take a week gap in the middle due to burn blisters.  Not keen to get more of them :))

The polymorph I mentioned earlier is very bendable for about 30 seconds after sitting in hot water and adjustable for another 10 so not too bad.  My latest thinking is to make two knuckle-shaped thin sausages and lay them on a desk.  Then reheat the places where the switches will go and push them in to get them to grip and melt a couple of notches in the ends.  Next I'll somehow hold/prop it up with the switches in position and loop another piece round both ends to secure them, and finally heat where the "loops" meet the "sausages" to stick it together.  Hopefully I can keep the switches openable for spring/stem swaps...

After repeating this for the four(?) sections of switches will come the biggest problem of how to stick it all together, but I'll tackle that when I get there.  This may well be where the hot glue comes in which will be fine while making the left hand but I don't like my chances when it comes to doing it wrong handed :-X


If this is actually happening should the thread be moved to the making stuff together! section?  And where are your pics?!

edit: so, you're right.  No way this stuff is going to work.  I managed one strip of 4 switches but they're wonky and not spaced widely enough for anything but fingertip use, and they aren't staggered enough for that.  Two switches mounted in a loop works, but what use are 2 switches when you have 4 fingers?  Not much :(

More


« Last Edit: Tue, 06 October 2015, 16:22:09 by suicidal_orange »
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
lol, yeah i did stuff like that in my head for what must have been over a month.  couldn't ever figure out how to piece it all together without it all being once piece to begin with.

yeah maybe it's a better thread in the make stuff together forum.  might get even more participants :thumb:

my lame pictures from like 6 weeks back i figured i'd not post and save myself the embarassment :confused:

this is as far as i got before i couldn't add anymore without icecream sticks.  now i've got the thing torn down /w an icecream stick in place of the thumpad panel which i need to redo /w clay. 

amazon cutter tool arrived today, so i can try to make a corner piece of skeleton for attaching the outside row of 4 keys...module..

113030-0
113032-1

« Last Edit: Tue, 06 October 2015, 20:51:47 by Camineet »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
Looks way more usable than my efforts, good work!

Did you wire the switches up first?  I don't see any wires but it looks pretty solid so hard to add them later.  And definitely no switch top removal as they're really stuck in there...  If I did the wiring first my beloved hot glue would be a viable option :))

In other testing I tried an MX brown with the back of my pinky and it felt quite stiff, will have to look into a lubed linear or maybe a Geteron clear spring (35g) for that spot.

I nearly reported the thread to the mods so they could move it but decided I should leave it up to you to decide if you want to do that or start a new one :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
naw, you overestimate my electronics skills.  glad you like the mockup, but it's just a lump of clay in those pics.  i haven't gotten into any of the electronics yet really.

at the moment, the finnish guy has just agreed to do the vita stick mod this week and ship it out soon. 

and i still need to order soldering stuff in order to assemble the proto board just so i can do that really long tutorial for using buttons and turning on lights.  i really have to start from teh basics because i've never done any of this stuff.

yeah, those keys are stuck in there.  but they're easy to pull off.  i plan to use hot glue or one of those other permanent options once i get further along.  i know how it is with materials like your hot glue.. once you get used to working with something, you wanna continue making everything with it ;D

35g switches would indeed be better for the outside keys.  i couldn't find anything lower than 40g in my internetting.

yeah, go ahead and report to mods and we can maybe get some more participants in that other forum :thumb:

Offline user 18

  • * Senior Moderator
  • Posts: 2159
  • Location: Ontario, Canada
Moved :thumb:
Please PM me if you are waiting on classifieds approval or have a question about the classifieds rules. | geekhack Terms of Service

Max Nighthawk x8 (MX Brown) | CM QFR (MX Blue) | CM QFR (MX Clear) | RK-9000 (MX Red) | Model M 1391401 | Model M SSK 1370475 | CM Novatouch | G80-8113 (MX Clear) | 60% (85g MX Blue) | Whitefox Aria (MX Clear) | CL-LX (MX Clear) | Mira SE (MX Clear)
Avatar by ashdenej

Offline Camineet

  • Thread Starter
  • Posts: 287
Cutting this was every bit the giant pain in the balls I knew it would be.  Took like an hour, is pretty sloppy on one side.

Hopefully it will serve well enough to provide internal rigidity needed for me to be able to clay up the module for the outside row of keys :'(

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
Is that milled out of wood?  It really doesn't look a nice shape to make but you'll never see the roughness when it's covered in clay so all good :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
Naw, that's just some plastic I cut out of an old plastic housing from a Lucent PBX phone system that I found in my basement xD

I'm pretty shy on tools over here so milling and stuff is just foreign-language to me :/

But yeah, it will be fine when covered in clay. I've actually found that every arm of this thing will need a skeleton piece inside because the Clay has a tendency to crack and without something inside to maintain the structure it just falls apart.

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
No fun tools here either :(

I saw something in someone's project where they were holding switches between the wire of a coathanger - that would make a nicely adjustable skeleton to mold around, if I can find one of a nice thickness.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
wow, wire hangers is a pretty good idea :)

i went on a rampage a few years ago after getting sick of cheap wire hangers and threw them all away yelling 'no wire hangers in this house' like that old movie mommie dearest  :confused:

have to see if i can scrounge one up and give it a try ;D

Offline zlittell

  • Posts: 80
  • Location: NW IN
    • My Projects
You really need something to make the basic shape that fits in the hand well and then 3D scan it into the PC.  Then you could model in all the goods for the switch, thumbstick, and electronics.  Get it 3D printed.  Maybe even leave areas to fill with a rubber like material of some sort.

Also if you are looking to have this show up as a joystick instead of a keyboard I will put a shameless self plug in here.  www.zlittell.com
I list some of the cons of using USB hid as a joystick in the beginning of my post.

Offline Camineet

  • Thread Starter
  • Posts: 287
yes please plugs give more awareness to the thing.

will be in touch with planned work of sugru for the torso of the spider if successful.

Offline Camineet

  • Thread Starter
  • Posts: 287
small update of alien genitals 3rd mockup ^-^

As I mentioned before, I have found that all legs of the spider require a skeleton piece if I am to use this particular sculpting Clay called  Sculpey found on Amazon.

This particular Clay doesn't require water, so it's good to work with for mockups. But it remains floppy and actually breaks apart on its own when sitting for a while.

These pics include the newly created skeleton piece for the outside keys leg (a piece of plastic i cut from a lucent pbx phone system box), along with the primary handle leg skeleton piece that I fashioned from a staple remover and plan implement in the coming days/weeks.

What I have now also found is that the torso remains floppy, and so it will be necessary for all of the legs to be tied together with a rigid material. So, I ordered a pack of Sugru and will rebuild the entire unit leg by leg and see how that goes. 

The part from Finland arrived, and it looks like fine work.

I've also ordered a soldering kit so I can put together the proto-Shield that will allow me to do the tutorial which will give me some basic electronics skills.

That's all for the past two weeks or so. Yes, I do know that this thing looks quite wretched ;D And it may in fact look wretched when it's complete :))
« Last Edit: Sun, 08 November 2015, 11:13:49 by Camineet »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
Looking good, I can see how it's all going to fit together now.  If it's comfy and it works who cares how it looks :thumb:

If you're hoping to replace all that pinkish stuff with Sugru you're going to need a lot more than one pack though, unless there's a lot of solid stuff hiding in there.  Also don't forget you need to get some wires to the switches!
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline W11cE

  • Posts: 23
Hi. Im the guy from the XIM forums that made the adapter.

Looking interesting. Many same ideas that me and some friends had on our keypad modding era.
How well can you hold it in your hand? Can you get a good grip, because with squeezing your fingers you press the keys instead of trying to keep it tighter in your hand.

Offline Camineet

  • Thread Starter
  • Posts: 287
seems to be no problem sitting in hand and not falling out.  that's the reason for the alien's full set of genitals, to act as a hand rest of sorts.  the weighting seems to be good too as far as hitting outside keys goes.  but only until i get further will i be able to confirm functionality.

and from the "let's still only use our thumbs to play games" camp we have...

https://www.kickstarter.com/projects/1384390939/grifta-morphing-gamepad

at least the king's assembly doesn't waste all those input possibilities...

https://www.kickstarter.com/projects/70308014/kings-assembly-a-computer-mouse-full-of-awesome/description

not ergonomic enough for my hands to avoid RSI in the long-term, but still a fine piece of work i'd say.


Offline Camineet

  • Thread Starter
  • Posts: 287
Looking good, I can see how it's all going to fit together now.  If it's comfy and it works who cares how it looks :thumb:

If you're hoping to replace all that pinkish stuff with Sugru you're going to need a lot more than one pack though, unless there's a lot of solid stuff hiding in there.  Also don't forget you need to get some wires to the switches!

it will be only as much sugru as required to get a rigid structure.  then i will build it out with this cheap clay which is good for embedding wires and stuff. and this clay doesn't really get dirty as far as i can tell.  stuff doesn't easily stick to it so i think it can be dusted pretty nicely :cool:

Offline Camineet

  • Thread Starter
  • Posts: 287
extremely pleased with sugru.  used only 2 of the 8 packs that came.  so, just about 5 dollars worth.  this product is very easy to shape and work with and i can see why its got so much buzz.

this is the first piece of the reconstruction.  i'll try to tackle another leg next week.

hopefully have set the angles right for neutral hand position with zero required extension at rest.

115690-0
115692-1
115694-2
115696-3
115700-4
115702-5
115704-6
« Last Edit: Sun, 08 November 2015, 11:08:28 by Camineet »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
This is coming together nicely, glad to hear the sugru is working out :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
completed proto-shield assembly today.  first time soldering and was like, 'well here goes nothin' :-X
« Last Edit: Sun, 08 November 2015, 11:12:07 by Camineet »

Offline Camineet

  • Thread Starter
  • Posts: 287


This is coming together nicely, glad to hear the sugru is working out :)

yeah thanks for saying so.  it was a pretty good day in the shop except for the part when i put the power rails on and all the solder bled together.  spent a while on youtube learning how to desolder with wicking until i realized the power rails connection is supposed to run together ;D

Offline Camineet

  • Thread Starter
  • Posts: 287
Getting started on the area that is going to be the biggest challenge for me :-X

I managed to get a light to turn on ;D but I think the rest of this part of the project is going to be pretty time-consuming for me.

at any rate, after watching the league of legends world finals these past few days, I'm resolved to start putting more time into this project so I don't die of league malnourishment. I think it's already been three months since I played.  back to the tutorials now :eek:
116273-0

Offline Camineet

  • Thread Starter
  • Posts: 287
behold... blinking lights ;D
116341-0

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
behold... blinking lights ;D
(Attachment Link)

Very nice, but aren't you supposed to be playing with switches? :))
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
no kidding :D

Offline Camineet

  • Thread Starter
  • Posts: 287
Have run into my first fail and need help :rolleyes:

I can't get the Leonardo board to run the hello world sketch. Nothing is output to the serial monitor all.

I follow the instructions in this tutorial here:

http://www.ladyada.net/learn/arduino/lesson4.html

Resetting the board doesn't get it to output anything in the serial monitor.  Resetting just results in the L led blinking once followed by the RX led blinking twice.  The TX led doesn't light at all which I understand is the indication that data is sent to the PC to be output on the serial monitor.

I tried reloading the blinking lights sketch and that works fine. So I've confirmed that I can upload sketches and they work. But I can't seem to get the hello world sketch to work at all and don't have enough experience to guess what might be wrong.  I've reloaded blink and hello world back and forth about 4 times just to see if I could get hello world to work, but no luck.

Here's the sketch from the tutorial that I'm using:

/*
 * Hello World!
 *
 * This is the Hello World! for Arduino.
 * It shows how to send data to the computer
 */


void setup()                    // run once, when the sketch starts
{
  Serial.begin(9600);           // set up Serial library at 9600 bps
 
  Serial.println("Hello world!");  // prints hello with ending line break
}

void loop()                       // run over and over again
{
                                  // do nothing!
}

Here's a screenshot of the arduino application on my PC:

116381-0

help would be much appreciated :confused:

Offline Camineet

  • Thread Starter
  • Posts: 287
*oh, and I tried removing the proto-shield just to see if it might have been somehow interfering /w the hello world sketch.  but still no luck getting the sketch to output anything.

Offline neverused

  • Posts: 572
Do you get an error when uploading? Did you open the serial monitor? (use ctrl +shift+m)

Offline Camineet

  • Thread Starter
  • Posts: 287
thanks for reply ;D

no error when uploading i'm sure because i've seen them before and know what they look like.  there's some red stuff.  every so often the com port gets lost or something and i have to reset the board to get leonardo on com 5 to show up again.

but i don't get any error message when uploading hello world.

tried opening and closing serial monitor about 20 times.  before resetting board, and after.

here's a pic of the serial monitor.  baud rate matches sketch.  i'm stumped :'(

116390-0

Offline neverused

  • Posts: 572
Hmmmmm I'm not sure what the issue is. However since your goal is physical hardware with individual outputs, you may look at these tutorials: https://www.arduino.cc/en/Tutorial/BuiltInExamples

They are built into the IDE, are well documented, and explain the code to you. If you have a single switch, you can start on the digital examples.

Offline Camineet

  • Thread Starter
  • Posts: 287
I guess I'll try this tutorial to see if I can get a button to send data to the PC:

https://www.arduino.cc/en/Tutorial/BuiltInExamples

If that fails, I'm going to need to get a new board.

Troubleshooting has been done as follows:

I tried two other USB cables because sometimes those things can act funny.  No results.

I tried the whole set up on another PC. No results.

I think the board is faulty. If it can't even send hello world to the serial monitor, I doubt that it's going to send zeros and ones to the serial monitor as in the button tutorial above :'(


Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
Have you tried asking it to send keyboard keypress like you'll be doing in your controller?  Not sure if it uses a different connection method but it certainly doesn't output anything to the serial montior while typing, so I'd guess it's on a separate USB endpoint.  This keeps typing n once every 10 seconds so it's pretty useless, but good enough to test and slow enough to not interfere when you want to flash with something else useful :)

Code: [Select]
void setup() {
  Keyboard.begin();
}

void loop() {
  Keyboard.press('n');
  delay(100);
  Keyboard.releaseAll();
  delay(10000);
}
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
this works :thumb:  thanks as always for the help.  i had already gotten rma from UK seller nn.. have to upload a diff sketch to stop the 'n's :))

had already gotten rma from UK seller but figured shipping wouldn't be worth it.  then shopped for new board from local seller but won't need a new board it seems.

i guess i'm back on track now and will continue tinkering :cool:

Offline Camineet

  • Thread Starter
  • Posts: 287
trimmed proto-shield pics post to make page less obnoxious when loading  ;)

Offline Camineet

  • Thread Starter
  • Posts: 287
I've been thinking about this and how close it is to being able to use two as a full keyboard, so why not add another switch per finger?

Show Image


In place of the joystick I'm thinking three switches per thumb which still only takes the keycount to 38, but adding two imaginary 5th fingers (operated by the index fingers being raised toward the thumb) would make 46, which is more than a JD40...

you and blahlicus are right, more is better.  league has a lot of commands, and making as many to be immediately available as possible without resorting to alt keymaps is helpful.

i've had some designs in my head for adding a fingertip row of keys as in blahlicus' drawing.  if that works out, it may be possible to add a 4th row of keys as in your drawing here. 

still, league has a ton of commands needed, and i working on this project with the goal of having alt keymaps available via xpadder.

alt keymaps are very helpful for lesser used commands such as leveling up abilities by using the same button as the ability but with a modifier key to access the alt keymap. 

another example, radial ping picker doesn't work in league for those of us using alternative pointer input devices such as my pen tablet.  this limitation creates the need for even more available keys than normal players need.  in such cases, one must bind a key for each of the 4 pings.  again, alt keymaps are very helpful for these kinds of things. 

items 1,2,3,4?  bound to the 4 'home' keys of league 'qwer' on yet another keymap.  very effective in my experience.  maybe even better than standard keyboard 'cause your fingers don't have to move at all from league home keys, you just press down with your thumb or something to get to alt keymap. 

but there are some things such as 'return camera to champion' button that needs to be immediately available.  same with a ton of other stuff like 'score = tab', 'shop', and of course summoner spells...

Offline Camineet

  • Thread Starter
  • Posts: 287
ready for next steps i think....

i've had about enough of learning basics of what's going on with these devices by doing tutorials, recently having completed this one which has the pin report to the pc whether it's high or low.

116664-0

if possible, i want to move forward now with trying to get some things wired up and programmed for the actual application i'm working towards. 

just now, i've successfully tested this gamepad sketch on my Win 7 PC and it works :thumb:

http://www.instructables.com/id/Add-USB-Game-Controller-to-Arduino-LeonardoMicro/?ALLSTEPS

now i'm stuck because i can't find what to do next.  for my application, i need the leonardo to be acting as a game controller, not as a keyboard and/or mouse(?).  that's because i need the leonardo to be recognized in xpadder, which it is after implementing step 1 from the instructable above.

xpadder is particularly important for this project because of the need for alt keymaps.  As iíve mentioned before, iíve used alt keymaps in league before to succesfully get over 20 commands to be available on a limited number of keys, whether it be xbox or ps3 controller (both of which iíve used in the past to play lol and developed RSIs using both).

My problem now is that i canít find any other youtubes or other tutorial sources that discuss what happens when leonardo is acting as a game controller.  I can only find stuff about the out-of-the box keyboard and/or mouse capabilities.

Can someone please point me in the direction of where i can get basic understanding of some things?

To begin with, iíd like to see and test an example of how to wire up a single switch to the board along with a sketch that causes the button to act as one of the buttons recognized by windows as a game controller buttonís input.

From the comments for the instructable above...
ďConnecting one button to an Arduino
is easy. You can just connect one side of the button to ground and the other side
to a digital input pin.Ē

So i guess thatís easy enough.  But i still need a sketch that invokes the boardís internal pin resistors and tells the pin to be an input that sends a game controller button activation to the PC right?
If someone can help me with that, iíd really appreciate it. 

Going forward, i gather that i will be limited to the 13 available pins on the board for my total switch count unless i use this...

http://forum.arduino.cc/index.php?topic=8558.0

or this...

http://www.instructables.com/id/How-to-access-5-buttons-through-1-Arduino-input/

neither of which i want to bother with due to my skill level.



Offline Camineet

  • Thread Starter
  • Posts: 287
one more thought about desire to have xpadder involved.

something like alt keymaps are certainly possible in keyboard mode by just mapping commands to keyboard combos like ctrl + a.  but this approach limits to only 3 possible alt key commands by using the ctrl, alt, and shift keys.  that's not a big problem perhaps.  but it's better to have 4 keymaps available by using xpadder in my experience. 

also, some games don't like certain keyboard combos.  for example, a game might allow ctrl + something, but for whatever reason it may not allow 'alt' + something.

also, analog stick adjustments for use as a digital camera control in league are very easy in xpadder as they can be done in the xpadder interface which is a gui instead of coding.

anyway, i suppose i can live without xpadder if it's not possible or practical to use it here.

Offline Camineet

  • Thread Starter
  • Posts: 287
*oh, i forgot that AdryD posted earlier in this thread how to connect a single switch /w a sketch for it using internal pulldown resistor.  i think i'll try this...

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
You've gone beyond my knowledge of windows and gaming controllers, but is this how you want it to show up?
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
wired up this here

116690-0

and uploaded this sketch from AdryD's post:

Code: [Select]
void setup(){
  pinMode(2,INPUT_PULLUP);
}
void loop () {
}

as expected, it doesn't do anything.  i checked to see if a game controller button would be recognized or any keyboard input.  i guess it's pretty obvious there is a need for some code to do that. 

Offline Camineet

  • Thread Starter
  • Posts: 287
You've gone beyond my knowledge of windows and gaming controllers, but is this how you want it to show up?

yep, i was able to get the board to show up succesfully as a game controller just as in that instructable.  and then i launched xpadder and found that the leonardo board was available to be configured just as any gamepad.

at this point, i just need to know how to connect the buttons to the board and get the board to send each button's press to the pc as a gamepad button activation.

in other words, i need to get something to light up here when a button is pressed
116692-0
« Last Edit: Sun, 08 November 2015, 13:35:24 by Camineet »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
I don't have an Arduino handy but think this should work for one button, it compiles ok...

Code: [Select]
boolean oState = HIGH;
boolean buttonState = HIGH;

void setup() {
  pinMode(2,INPUT_PULLUP);
  Joystick.begin();
}

void loop() {

  buttonState = digitalRead(2); //read physical button 2
   
  if(buttonState != oState) { //check against previous button state, if changed do something
    if(buttonState == LOW) { //button has been pressed
      Joystick.pressButton(0); //press "joystick" button 1
    }
    else { //button has been released
      Joystick.releaseButton(0); //release "joystick" button 1
    }
  oState = buttonState; //save state to compare next time
  }
}

From reading the example sketch I have no idea how they connected their many buttons...
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
can someone tell me a good wire to buy?  i already have solid core hookup wire from sparkfun for building the main parts of this project.

but i need some stranded wire for something.

the project will be like this...

handset switches soldered to solid core wires terminating at the bottom of the handset =>

about 1 meter of stranded wires soldered to the ends of each of the switches' solid core wire connections.  this meter of wiring goes between the handset and the project box which will house the board and will sit on desk.  these wires will be housed in a wire mesh, wire loom like this:

https://www.hobbyking.com/hobbyking/store/uh_viewItem.asp?idProduct=51285

the board will just be connected to pc via usb, so i don't need any help with that.

any suggestions on a good place to buy 22awg or 24awg stranded wire for the 1 meter of wiring that goes between the handset and the project box?  22awg or 24awg would be suitable right?  it needs to be stranded wire for flexibility right?  solid core breaks after a lot of movement i would guess.

hobbyking doesn't seem to have any suitable wires. anyway, i built this in 2014 almost entirely out of hobbyking parts and found the hobbyking shopping experience to be pretty undesirable...

https://endless-sphere.com/forums/viewtopic.php?f=35&t=55422&start=75#p865840

also, adafruit doesn't seem to have any wire like this and their shipping is expensive.

sparkfun's shipping charges are great, but no stranded wire there :'(


Offline Camineet

  • Thread Starter
  • Posts: 287
I don't have an Arduino handy but think this should work for one button, it compiles ok...

Code: [Select]
boolean oState = HIGH;
boolean buttonState = HIGH;

void setup() {
  pinMode(2,INPUT_PULLUP);
  Joystick.begin();
}

void loop() {

  buttonState = digitalRead(2); //read physical button 2
   
  if(buttonState != oState) { //check against previous button state, if changed do something
    if(buttonState == LOW) { //button has been pressed
      Joystick.pressButton(0); //press "joystick" button 1
    }
    else { //button has been released
      Joystick.releaseButton(0); //release "joystick" button 1
    }
  oState = buttonState; //save state to compare next time
  }
}

From reading the example sketch I have no idea how they connected their many buttons...

oh hell yes :p

it works and i just immediately launched xpadder, mapped the single button to F, launched league custom single player game to test and flashed (made kha'zix, a league champion, blink forward) with my leonardo board!

must be over 3 months i've been waiting for true signs of life from this project, and this is it ;D

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4203
  • Location: England
Thin wire, and lots of it?  You could get some on amazon (random example, may be available cheaper/in a more appropriate quantity) or if you have any Cat 5e Ethernet cables lying around at home/work/school they contain 8 strands of 24AWG.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Camineet

  • Thread Starter
  • Posts: 287
Thin wire, and lots of it?  You could get some on amazon (random example, may be available cheaper/in a more appropriate quantity) or if you have any Cat 5e Ethernet cables lying around at home/work/school they contain 8 strands of 24AWG.

oh yeah thanks, this would probably work quite well :thumb: