I have an HTML5 ping pong game. You can check it out at (http://pong.hackrdojo.com/). How do I make a controller, where I can use a breadboard interface with two buttons all linked to an Arduino microcontroller for moving the paddle up and down?
-
You'll probably need to build a browser extension/plugin to communicate with the controller.bfavaretto– bfavaretto09/26/2012 23:50:41Commented Sep 26, 2012 at 23:50
-
1Check out github.com/rwldrn/johnny-fiveaknosis– aknosis09/26/2012 23:50:57Commented Sep 26, 2012 at 23:50
-
@Aknosis that link looks amazing! Thanks a lot bud!Charles– Charles09/26/2012 23:57:12Commented Sep 26, 2012 at 23:57
Add a comment
|
2 Answers
An even easier method is to buy an arduino leonardo board (cheap on ebay). There is demo code to create a keyboard.
- Map your pots and switches to a specific key like up down on keyboard etc.
- If you are using windows you could then use a program called glovepie that lets you set up profiles to remap the key for the specific key to the game to save reprogramming the arduino for each game.
Have fun making out there game controllers. That's how I did it and it works beautifully.
-
Are there any links you could provide that might be helpful?JSuar– JSuar01/03/2013 23:30:30Commented Jan 3, 2013 at 23:30
Right now I am going with Aknosis' solution of using Johnny Five(https://github.com/rwldrn/johnny-five)
I am open to any other alternatives.
-
Johnny Five looks great, but isn't it server-side js? I thought you wanted to interface with the browser.bfavaretto– bfavaretto09/27/2012 00:04:49Commented Sep 27, 2012 at 0:04
-
Yeah, this would mean doing push a command from the Arduino to the server and from the server I push it to the client side. I guess the other alternative would be to write my game in C and but where is the fun in that? :)Charles– Charles09/27/2012 00:08:17Commented Sep 27, 2012 at 0:08