Pages: [1]   Go Down
Author Topic: Arduino Uno Gamepad (Input to Game)  (Read 582 times)
0 Members and 1 Guest are viewing this topic.
Austria
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I've wanted to realize a Gamepad with a Arduino Uno Rev. 3
I have bought some Buttons and connected it to my Arduino.

With this short code i can put the signal from 0 to 1.

void setup(){
   Serial.begin(9600);
   pinMode(2,INPUT);
}

void loop(){
   int buttonstatus;
   buttonstatus = digitalRead(2);
   Serial.println(buttonstatus,DEC);
}

Now my Question is, how to use this signal for a game. So that i can press the Button and the game realise that i press it. It should work the same like a keyboard.

Please help me smiley
Thank you very much,
Mario
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It should work the same like a keyboard.
Question, is this going to be a controller for a computer, or an actual gaming console?

Look at the keyboard example provided in the playground and maybe gamepads and joysticks.
NOTE: Only works with Arduino Leonardo!
http://playground.arduino.cc//Main/InterfacingWithHardware#joygame

« Last Edit: February 11, 2013, 08:25:38 am by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Austria
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It will be controlled by a computer.
So what i need is a Arduino Leonardo and set the Inputs as keyboard signals?

Thanks smiley
Mario
Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 65
Posts: 2934
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It will be controlled by a computer.
So wait, are you building a controller to control a computer or use the computer as a controller to control a console?
It is two different things then. If you control a computer, then you would use the keyboard library with a Leonardo. BUT, if you want to trick a console to think the arduino is a controller, it is much different.
« Last Edit: February 11, 2013, 08:48:45 am by HazardsMind » Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Pages: [1]   Go Up
Jump to: