OK so there's this project that i want to do and i don't know where to start. I'm trying to learn the coding language i think it was c++. I play minecraft and you can change your controls so what I want to do is i want to program my arduino to work with my computer keyboard so that i can change my controls to an external button that i could have elsewhere. Is this possible and how could i do it. if it helps i have a Dell windows XP 2002 desktop computer. URL's would be appreciated. It would help to know what programs i need to do these things
What Arduino board do you have?
so that i can change my controls to an external button that i could have elsewhere.
Not too sure I get that.
However the Arduino Leonardo and Arduino Micro can both be made to look like a keyboard and could fire stuff into your computer.
I have arduino Uno R3 i believe
Quote
so that i can change my controls to an external button that i could have elsewhere.
Not too sure I get that.
However the Arduino Leonardo and Arduino Micro can both be made to look like a keyboard and could fire stuff into your computer.
what i mean is that i'm trying it improve my game play so i wanted to add 6 new buttons. the first four would be movement. Forward, back, left, and right.the next to would be crouch and jump. so is it possible to program it so i can have 6 buttons attached and have it register the 6 new buttons like they are part of the keyboard so when i go to config my controls i can choose each of the 6 buttons separately and be able to use the buttons as i play minecraft instead of the keyboard.
Does that help any? if not ask me what is still confusing and ill try to answer it. oh and i will be cheeking this daily so yea. thanks
oh and you can message me and i will cheek that as well
Fine, the answer I reply #2 still stands, you need a diffrent type of Arduino.
I do?
Alright what arduino would you recommend. And if you could direct me in the direction that would help me program it to do these things
ok so i looked at the Arduino Leonardo and it looks/sounds like what i need. so i did a little more research on how to program a button and that is what i got. is it good or no? or is it what i need or no?
int inPin = 7; // pushbutton connected to digital pin 7
int val = 0; // variable to store the read value
void setup()
{
pinMode(inPin, INPUT); // sets the digital pin 7 as input
}
void loop()
{
val = digitalRead(inPin); // read the input pin
}
Why not test it on your Uno? The code is the same. It would take you less time to test it than it would for us to answer that question.
That is right but stops short. What are you going to do with the variable val?
It can then be used in an if statement to light up the led on pin 13, set that pin to an output first.
Ultimately you want that to press a key on your PC and that you can only do with the Leonard or the Micro, not the UNO.
If you play other games, you may want to look into a speed pad. An Arduino solution is very cool, and worth doing, but a speed pad is programmable and ergonomic, and is about the same cost. Google Nostromo N52 for more.
This is some code I wrote a bit ago for the Leonardo, it will type random buzz words into any document you are writing by simply connecting pin 2 to ground. ( Through a push button if you like )
// Buzz phrase generator - Mike Cook May 2012
// For the Arduino Leonardo
// Ground pin 2 for a buzz word phrase to be typed in directly into your report
// add extra words in before the "0"
String word1[] = { "integrated ", "synchronised ", "responsive ", "parallel ", "balanced ", "total ", "functional ", "user friendly "
"optimal ", "compatible ","new ", "64-bit ","synergetic ","*"};
String word2[] = { "managerial ", "organisational ", "monitored ", "reciprocal ", "digital ", "logistical ", "transitional ",
"incremental ", "fifth generational ", "lifestyle ", "aspirational ", "*"};
String word3[] = { "policy ", "options ", "flexibility ", "capability ", "mobility ", "programming ", "concept ", "time phase ",
"projection ", "hardware ", "software ", "contingency ","*" };
int numberOfWords1=0,numberOfWords2=0,numberOfWords3 =0;
void setup() {
// make pin 2 an input and turn on the
// pullup resistor so it goes high unless
// connected to ground:
pinMode(2, INPUT_PULLUP);
Keyboard.begin();
// find out how many words are in each array
while(word1[numberOfWords1] != "*") numberOfWords1++;
numberOfWords1--; // to make random number call correct
while(word1[numberOfWords2] != "*") numberOfWords2++;
numberOfWords2--;
while(word1[numberOfWords3] != "*") numberOfWords3++;
numberOfWords3--;
}
void loop(){
while(digitalRead(2) == HIGH) {
// do nothing until pin 2 goes low
delay(50);
random(0,100); // just keep the random number ticking over
}
delay(100);
Keyboard.print(word1[random(0,numberOfWords1)]);
Keyboard.print(word2[random(0,numberOfWords2)]);
Keyboard.print(word3[random(0,numberOfWords3)]);
// do nothing:
while(digitalRead(2) == LOW);
delay(100);
while(digitalRead(2) == LOW); // get rid of any bounce
delay(100);
}
Ok so the problem with using a speed pad is i ultimately want to removed the use of my hands. I guess I need to explain a little bit more. So these 6 buttons will be on the floor so I can push them with my feet. The first four the movement keys will be in a plus like a d-pad the next to will be next to that so just imagine a bigger version of the old fashion Nintendo remote.
o
o o o o
o
The "o" is the buttons
So that's how it will look like under my desk
i tested this in the arduino programming thing and it said it was good and i wanted to know if this would add the extra buttons that i need
int up = 7; // pushbutton connected to digital pin 7
void setup()
{
pinMode(up, INPUT); // sets the digital pin 7 as input
}
void loop()
{
digitalRead(up); // read the input pin
}
You do not seem to be taking on board the aswears you have been given. You have posted that code before and been told about it. Stop going round in circles. If you don't understand something in an answer then ask, do not ignore it.