|
Arduino Leonardo with Headers |
x 1 | |
|
|
B3B-XH-AJST
|
x 1 | |
|
|
B5B-XH-A |
x 1 |
Arcade Shield V2.1
Buttons flash when pressed. And when the controller is plugged in, it can be animated.

Simply connect the card to the joystick and buttons.

More information on my blog.
// Arcade_Shield_v2
#include <Joystick.h>
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,JOYSTICK_TYPE_GAMEPAD,
10, 0, // Button Count, Hat Switch Count
true, true, false, // X and Y, but no Z Axis
false, false, false, // No Rx, Ry, or Rz
false, false, // No rudder or throttle
false, false, false); // No accelerator, brake, or steering
// Registre_a_decalage MC74HC595AN
// D21 pour l'Arduino Leonardo et D17 pour l'Arduino Uno
const int MEMORISATION = 23; // SER
// D22 pour l'Arduino Leonardo et D18 pour l'Arduino Uno
const int AFFICHAGE = 22; // RCLK
// D23 pour l'Arduino Leonardo et D19 pour l'Arduino Uno
const int BIT = 21; // SRCLK
// Mesure du temps
unsigned long tempsEcoule = millis();
void setup() {
// Boutons
pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
pinMode(6, INPUT_PULLUP);
pinMode(7, INPUT_PULLUP);
pinMode(8, INPUT_PULLUP);
pinMode(9, INPUT_PULLUP);
pinMode(10, INPUT_PULLUP);
pinMode(11, INPUT_PULLUP);
pinMode(12, INPUT_PULLUP);
// D18 pour l'Arduino Leonardo et D14 pour l'Arduino Uno
pinMode(18, INPUT_PULLUP);
// D19 pour l'Arduino Leonardo et D15 pour l'Arduino Uno
pinMode(19, INPUT_PULLUP);
// D20 pour l'Arduino Leonardo et D16 pour l'Arduino Uno
pinMode(20, INPUT_PULLUP);
//Registre_a_decalage
pinMode(BIT, OUTPUT);
pinMode(AFFICHAGE, OUTPUT);
pinMode(MEMORISATION, OUTPUT);
// Par sécurité, si bouton Start appuyé au démarrage
// la manette n'est pas activée
if (digitalRead(6) == 0) {
// Boucle infinie
while(digitalRead(6) == 0) {
clignoteTout(400);
}
}
// Animation (qui allume toutes les LED)
animationDebut(3000);
// Initialize Joystick Library
Joystick.begin();
Joystick.setXAxisRange(-1, 1);
Joystick.setYAxisRange(-1, 1);
}
int currentButtonState;
// Last state of the buttons
int lastButtonState[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
// Leonardo
int buttonMap[14] = {2,3,4,5,6,7,8,9,10,11,12,18,19,20};
// Uno
// int buttonMap[14] = {2,3,4,5,6,7,8,9,10,11,12,14,15,16};
// ButtonMap = 0, Pin 2 = UP
// ButtonMap = 1, Pin 3 = RIGHT
// ButtonMap = 2, Pin 4 = DOWN
// ButtonMap = 3, Pin 5 = LEFT
// ButtonMap = 4, Pin 6 = Start
// ButtonMap = 5, Pin 7 = Select
// ButtonMap = 6, Pin 8 = Button 1
// ButtonMap = 7, Pin 9 = Button 2
// ButtonMap = 8, Pin 10 = Button 3
// ButtonMap = 9, Pin 11 = Button 4
// ButtonMap = 10, Pin 12 = Button 5
// ButtonMap = 11, Pin A0 (18 ou 14) = Button 6
// ButtonMap = 12, Pin A1 (19 ou 15) = Button 7
// ButtonMap = 13, Pin A2 (20 ou 16) = Button 8
void loop() {
// Read pin values
for (int index = 0; index < 14; index++) {
currentButtonState = !digitalRead(buttonMap[index]);
if (currentButtonState != lastButtonState[index]) {
switch (index) {
case 0: // UP
if (currentButtonState == 1) {
Joystick.setYAxis(-1);
} else {
Joystick.setYAxis(0);
}
break;
case 1: // RIGHT
if (currentButtonState == 1) {
Joystick.setXAxis(1);
} else {
Joystick.setXAxis(0);
}
break;
case 2: // DOWN
if (currentButtonState == 1) {
Joystick.setYAxis(1);
} else {
Joystick.setYAxis(0);
}
break;
case 3: // LEFT
if (currentButtonState == 1) {
Joystick.setXAxis(-1);
} else {
Joystick.setXAxis(0);
}
break;
case 4: // Start Button
Joystick.setButton(0, currentButtonState);
break;
case 5: // Select Button
Joystick.setButton(1, currentButtonState);
break;
case 6: // Button 1
Joystick.setButton(2, currentButtonState);
affichageLED(B01111111);
break;
case 7: // Button 2
Joystick.setButton(3, currentButtonState);
affichageLED(B10111111);
break;
case 8: // Button 3
Joystick.setButton(4, currentButtonState);
affichageLED(B11011111);
break;
case 9: // Button 4
Joystick.setButton(5, currentButtonState);
affichageLED(B11101111);
break;
case 10: // Button 5
Joystick.setButton(6, currentButtonState);
affichageLED(B11110111);
break;
case 11: // Button 6
Joystick.setButton(7, currentButtonState);
affichageLED(B11111011);
break;
case 12: // Button 7
Joystick.setButton(8, currentButtonState);
affichageLED(B11111101);
break;
case 13: // Button 8
Joystick.setButton(9, currentButtonState);
affichageLED(B11111110);
break;
}
lastButtonState[index] = currentButtonState;
}
}
if ((millis() - tempsEcoule) >= 80){
affichageLED(B11111111);
}
delay(10);
}
void animationDebut(int duree){
affichageLED(B00000000);
delay(duree/8);
affichageLED(B10000000);
delay(duree/8);
affichageLED(B10100000);
delay(duree/8);
affichageLED(B10101000);
delay(duree/8);
affichageLED(B10101010);
delay(duree/8);
affichageLED(B10101011);
delay(duree/8);
affichageLED(B10101111);
delay(duree/8);
affichageLED(B10111111);
delay(duree/8);
affichageLED(B11111111);
}
void clignoteTout(int duree){
affichageLED(B11111111);
delay(duree/2);
affichageLED(B00000000);
delay(duree/2);
}
int affichageLED(int leds){
digitalWrite(AFFICHAGE,LOW);
shiftOut(BIT, MEMORISATION, LSBFIRST, leds);
digitalWrite(AFFICHAGE,HIGH);
tempsEcoule = millis(); //Mise à jour du temps
}
Arcade Shield V2.1
Project images are for reference only. Actual production is based on the manufacturing files on the project page.
Please review the designer's notes (e.g., PCB thickness) and select the appropriate options.
PCBWay is not responsible
for issues caused by unsuitable parameter selections.
For more important ordering information, please refer to
Read More
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(2)
-
Sergio Oliveira
Jun 18,2025
-
Engineer
Oct 01,2024
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Arduiblog
-
Goodies arduiblog.com for Maker Faire Paris 2026
Solder the battery holder and fuse to the back of the board and place the flashing LEDs in the chick...
-
Arcade Shield V2.1
Buttons flash when pressed. And when the controller is plugged in, it can be animated.Simply connect...
-
Arcade Shield V1
Replace the card supplied in the Arcade KitWith an Arduino Leonardo.More information on my blog and ...
-
Programmable Mist Maker - XIAO / QT PY Extension
1226 2 1 -
RadioHAT - Raspberry Pi radio development platform
1032 0 2 -
QWIIC-VL53L4CD Time-of-Flight Distance Sensor Module
1251 0 1 -
-
-
-
ARPS-2 – Arduino-Compatible Robot Project Shield for Arduino UNO
3442 0 6 -
-
A Compact Charging Breakout Board For Waveshare ESP32-C3
4077 3 8 -
AI-driven LoRa & LLM-enabled Kiosk & Food Delivery System
4472 2 2







