int button1 = 2; // Set a button to any pin
int button2 = 3; // Set a button to any pin
int button3 = 4; // Set a button to any pin
int button4 = 5; // Set a button to any pin
int button5 = 6; // Set a button to any pin
int button6 = 7; // Set a button to any pin
int button7 = 8; // Set a button to any pin
int button8 = 9; // Set a button to any pin
int button9 = 10; // Set a button to any pin
int button10 = 15; // Set a button to any pin
void setup()
{
pinMode(button1, INPUT); // Set the button as an input
pinMode(button2, INPUT); // Set the button as an input
pinMode(button3, INPUT); // Set the button as an input
pinMode(button4, INPUT); // Set the button as an input
pinMode(button5, INPUT); // Set the button as an input
pinMode(button6, INPUT); // Set the button as an input
pinMode(button7, INPUT); // Set the button as an input
pinMode(button8, INPUT); // Set the button as an input
pinMode(button9, INPUT); // Set the button as an input
pinMode(button10, INPUT); // Set the button as an input
digitalWrite(button1, HIGH); // Pull the button HIGH
digitalWrite(button2, HIGH); // Pull the button HIGH
digitalWrite(button3, HIGH); // Pull the button HIGH
digitalWrite(button4, HIGH); // Pull the button HIGH
digitalWrite(button5, HIGH); // Pull the button HIGH
digitalWrite(button6, HIGH); // Pull the button HIGH
digitalWrite(button7, HIGH); // Pull the button HIGH
digitalWrite(button8, HIGH); // Pull the button HIGH
digitalWrite(button9, HIGH); // Pull the button HIGH
digitalWrite(button10, HIGH); // Pull the button HIGH
}
void loop()
{
if (digitalRead(button1) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button2) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button3) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button4) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button5) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button6) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button7) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button8) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button9) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
if (digitalRead(button10) == 0) // if the button goes low
{
Keyboard.write('z'); // send a 'z' to the computer via Keyboard HID
}
}
Would this work ?? the z's will be changed to the letter I want to be used.
What my friend and I are trying to do is make a old game emulator and put it into a TI-84 SE calculator. We are going to be using the rhasberry pi with Debian to install our Emulators for GBA,GBC, SNES, GC, ATARI, and NES on. We need the Arduino to send button presses from a pcb board we are making to the rhasberry pi via USB.