kombi-man
Well-Known Member
- Joined
- Mar 14, 2017
- Messages
- 486
if anyone here is an Arduino guru, please can you help me.. I'm not.
I have a working Arduino Micro board which has 32 buttons connected to it, and which works 100%. I need to add a little piece of code to the bottom of the existing "sketch" I think it's called, which forces a specific button to emulate pressing the "TAB" key, specifically.
I found this online. Bit if I load this, and then inspect it, it just give me the middle finger?
PS. I do NOT have a clue when it comes to programming or anything of this nature..
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();
}
void loop() {
//if the button is pressed
if(digitalRead(2)==LOW){
//Send an ASCII 'A',
Keyboard.write(65);
}
}
So, for my requirements, I understand we replace the '65' with '09' to replace the A with the TAB, but, also, on my wiring diagram of this switch box, I have an array of buttons wired across the pins, eg: A0 and 10, is the button I'd like this "code" above to work with. But, I can't even get the code to look right.
Please can you help?
regards
Alan
I have a working Arduino Micro board which has 32 buttons connected to it, and which works 100%. I need to add a little piece of code to the bottom of the existing "sketch" I think it's called, which forces a specific button to emulate pressing the "TAB" key, specifically.
I found this online. Bit if I load this, and then inspect it, it just give me the middle finger?
PS. I do NOT have a clue when it comes to programming or anything of this nature..
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();
}
void loop() {
//if the button is pressed
if(digitalRead(2)==LOW){
//Send an ASCII 'A',
Keyboard.write(65);
}
}
So, for my requirements, I understand we replace the '65' with '09' to replace the A with the TAB, but, also, on my wiring diagram of this switch box, I have an array of buttons wired across the pins, eg: A0 and 10, is the button I'd like this "code" above to work with. But, I can't even get the code to look right.
Please can you help?
regards
Alan