DIY USB Build Button

I wanted a cool way for building projects on IntelliJ, sure pressing that small green button on the top of my IDE was functional but i wanted a pleasing and noisy button to get the job done. What about a shiny red emercency button?

First we have to buy a big red button and an Arduino (or derivate) capable of appear as a native Keyboard, I chose a Pro Micro board from SparkFun


We need to make a little modification to the button removing two little screws like in photo; otherwhise we’ll have to rotate it in order to disarm it after pressed.


Now we can hook up some wires to Pro Mini pins, i used pin 9 enabling its internal pull-up, here the code:

int buttonPin = 9;

void setup()
  pinMode(buttonPin, INPUT);  // Set pin as input
  digitalWrite(buttonPin, HIGH);  // Enable internal pull-up
  Keyboard.begin();//Init control over keyb

void loop()
  if (digitalRead(buttonPin) == 1) //The emerg.button is normally closed!
    {;//Press Shift;//Press F10
        delay(100);//Wait for propag
        Keyboard.releaseAll();//Relase them all

That’s done!

2 commenti

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.