Pinball Controller Gamepad / Cabinett for PC '----- DIY -----

Описание к видео Pinball Controller Gamepad / Cabinett for PC '----- DIY -----

Full instruction!
Make your own Arduino based pinball game controller for PC!
Here I show you how you can make a pinball game console.
You download free programs and games from the web and then
you can play like on a real pinball machine with real controls.
This video shows all the necessary information.
You can find parts at Amazon.com
Lock for: Arduino Leonardo Board,
Micro switch, Puch button,
USB A-male cable, etc.

Good luck, and have fun!
Copy and Paste this Arduino scetch to your Arduino editor :

#include Keyboard.h // REM Please add angular bracets before and after Keyboard.h
// because these caracters are not allowed in this YouTube comments!!
void setup() {
Serial.begin(9600);
//while(!Serial);{ }
pinMode(2, INPUT_PULLUP); // = pin2, right switch h
pinMode(3, INPUT_PULLUP); // = pin3, left switch g
pinMode(4, INPUT_PULLUP); // = pin4, drawbar switch p
pinMode(5, INPUT_PULLUP); // = pin5, credits switch 5
pinMode(6, INPUT_PULLUP); // = pin6, players switch 1
}
void loop ()
{
int bryt2 = digitalRead(2);
if (bryt2 == LOW) {
Keyboard.press('h');}
if (bryt2 == HIGH) {
Keyboard.release ('h'); }
int bryt3 = digitalRead(3);
if (bryt3 == LOW) {
Keyboard.press('g');}
if (bryt3 == HIGH) {
Keyboard.release ('g'); }
int bryt4 = digitalRead(4);
if (bryt4 == LOW) {
Keyboard.press('p');}
if (bryt4 == HIGH) {
Keyboard.release ('p'); }
int bryt5 = digitalRead(5);
if (bryt5 == LOW) {
Keyboard.press('5');}
if (bryt5 == HIGH) {
Keyboard.release ('5'); }
int bryt6 = digitalRead(6);
if (bryt6 == LOW) {
Keyboard.press('1');}
if (bryt6 == HIGH) {
Keyboard.release ('1'); }
}

Комментарии

Информация по комментариям в разработке