Leonardo / Pro Micro

From sudomod
Jump to: navigation, search
Leonardo Pro Micro.png


The cheap alternative to the Teensy LC.

official Website


Guide/How To

The user IAmOrion wrote a guide on how to use the board. It can be found in the forum.

Guide for dummies

For people who are in no way experienced in programming an Arduino there's a detailed guide:

  • Download and install the Arduino IDE from the official website
  • Connect your pro micro to your PC via micro-USB cable (a red LED should light up)
  • Open the Arduino software, click on 'tools' and select the correct Board ("Arduino Leonardo") and Port (it should display a COM-Port with the description (Arduino Leonardo) after the Com-Port number)
  • Now you can Copy/Paste the following code into the provided area:
    #include <Keyboard.h>
    #define BUTTONS 15
    int pin_arr[]={2,4,3,5,14,16,9,8,A0,A1,6,7,A2,A3,15};
    int keycode_arr[]={218,217,216,215,128,130,32,129,122,176,53,49,112,177,179};
    // UP,DOWN,LEFT,RIGHT,LEFT-CTRL (Button 1), LEFT-ALT (Button 2),SPACEBAR (Button 3), LEFT-SHIFT (Button 4), Z (Button 5), ENTER (Button 6) (Enter instead of X so can use with other RPi things like raspi-config), Coin/Credit, 1P Start, P (Pause), ESC, TAB
    int key_state[BUTTONS];
    void setup() {
      for (int i=0;i<BUTTONS;i++)
        pinMode(pin_arr[i], INPUT_PULLUP);
        key_state[i] = digitalRead(pin_arr[i]);
    void loop() {
      for (int i=0;i<BUTTONS;i++)
        if (key_state[i]==LOW) {
          Keyboard.press(keycode_arr[i]); if (keycode_arr[i] == 49) { delay(100); }
        } else {
  • At last, check and upload the code by clicking the according buttons. After this, a green LED should light up additionally to the red one and your PC should recognize a new Keyboard device.
  • Done. You can test your setup now by connecting one of the Pins on the pro micro to ground and see if the according keyboard signal arrives at your PC.






I/O Pins

16 (18)



Buy it