Arduino Pro (Leonardo Micro)

Various user-contributed guides for hardware-related things
User avatar
supperdd
Posts: 7
Joined: Sat Sep 03, 2016 10:08 am

Re: Arduino Pro (Leonardo Micro)

Post by supperdd » Thu Nov 17, 2016 7:48 am

Yes i think the keyboard for emulator gba if i want to play games that need analog stick i will play with an external pad ...

I followed the instructions of this post but I block because my arduino asks me the library hid.h but I have them all install and it still will not :-(

User avatar
vnman
Posts: 147
Joined: Tue Jun 21, 2016 5:21 am
Has thanked: 5 times
Been thanked: 34 times

Re: Arduino Pro (Leonardo Micro)

Post by vnman » Fri Nov 18, 2016 3:22 am

don't know about yours board but mine came pre-program as "Leonardo Pro" and with keyboard emulation.

Maybe you can try to test yours without program the thing?

just connect the board to your pc and see what came up in Device Manager (if you using Windows).

User avatar
supperdd
Posts: 7
Joined: Sat Sep 03, 2016 10:08 am

Re: Arduino Pro (Leonardo Micro)

Post by supperdd » Fri Nov 18, 2016 8:12 am

As said above I do not use wondows but linux
And the leonardo that I buy on ebay was blank

devryd
Posts: 3
Joined: Tue Nov 15, 2016 5:13 pm
Been thanked: 1 time

Re: Arduino Pro (Leonardo Micro)

Post by devryd » Fri Dec 23, 2016 3:06 am

My buttons Do also have a delay.
I have tried bot sketches and non of them work better
Can anybody help me?

Kaikai
Posts: 13
Joined: Mon Feb 27, 2017 2:21 am
Has thanked: 1 time
Been thanked: 1 time

Re: Arduino Pro (Leonardo Micro)

Post by Kaikai » Sat Apr 01, 2017 2:32 am

IAmOrion wrote:
Thu Jun 16, 2016 7:46 am
I've started building my GBZ now :) - Big thanks to [mention=dominator]Dominator[/mention] for sending me the GBZ PCB and some stickers and buttons.

Anyway, I opted to use the Leonardo Micro instead of a teensy, pretty much same size.

http://www.ebay.co.uk/itm/201310315804

I wanted to share my arduino code that I used. I've used this same code on a Retro Arcade Machine Coffee Table I built

Code: Select all

#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() {
  Keyboard.begin();
  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++)
  {
    key_state[i]=digitalRead(pin_arr[i]);
    if (key_state[i]==LOW) {
      Keyboard.press(keycode_arr[i]); if (keycode_arr[i] == 49) { delay(100); }
    } else {
      Keyboard.release(keycode_arr[i]);
    }
  }  
}
Download link:
https://www.dropbox.com/s/hvwi92295z8qs ... o.zip?dl=1

the download also includes an additional header (not included in the compilation as it's for reference only) That lists all the Key Codes.

I hope this is of use to others
Hi, I am having some problems with getting this to work, but i'm a total noob here so i just try to follow the guides step by step as best i can. But i get the following error message
Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Leonardo"

test.ino: In function 'void setup()':
test:9: error: 'Keyboard' only supported on the Arduino Leonardotest.ino: In function 'void loop()':
test:22: error: 'Keyboard' only supported on the Arduino Leonardotest:24: error: 'Keyboard' only supported on the Arduino Leonardo'Keyboard' only supported on the Arduino Leonardo

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
I'm using the following code

Code: Select all

//#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() {
  Keyboard.begin();
  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++)
  {
    key_state[i]=digitalRead(pin_arr[i]);
    if (key_state[i]==LOW) {
      Keyboard.press(keycode_arr[i]); if (keycode_arr[i] == 49) { delay(100); }
    } else {
      Keyboard.release(keycode_arr[i]);
    }
  } 
}
If i do not comment out the first line i get this this error:
Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Leonardo"

test.ino:1:22: fatal error: Keyboard.h: No such file or directory
compilation terminated.
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino version 1.6.5
Tool - Board - Arduino Leonardo
Port:Com1
Programmer: AVRISP mkll

Any help i can get is appreciated :) any more info i should provide then please let me know.

sqwzy
Posts: 2
Joined: Thu Jun 01, 2017 12:37 pm

Re: Arduino Pro (Leonardo Micro)

Post by sqwzy » Thu Jun 15, 2017 12:55 am

so I have been trying for hours now. I'm getting bad button lag, and there as another red led on besides the power.
I'm using Arduino 1.5.6-r2 (it is the only version I have tried that actually lets me compile with no errors.)
can someone help me out. thanks

aggiehavoc
Posts: 24
Joined: Tue Aug 22, 2017 8:41 am

Re: Arduino Pro (Leonardo Micro)

Post by aggiehavoc » Wed Aug 23, 2017 11:52 am

voldemortvdk wrote:
Sun Aug 21, 2016 5:23 am
Raizan wrote:Hey, can someone tell me where shoud i connect the usb pads from the pi zero (from the usb hub) to the arduino pro board?
On the teensy lc you connect it to VCC D- D+ GND but the pro micro uses other...
Thank you
Please help, I have the same question.

I want to use Arduino Pro Micro, instead of Teensy.
On Teensy board, there are D+ / D- pins for connecting or soldering RPi's USB port.
But, Arduino Pro Micro, they are Tx/Rx,... pins, please tell me how to use those of pins, or any idea else. :|

Thank you :D
Is there a good guide for this? I am seeing conflicting information on how exactly to wire it up. I'd like to directly wire if possible to avoid having having to plug in a USB cable like the poster above did (to reduce space requirement). Do I wire into 5V+, GRD, TX, and RX? I've read some people say that you shouldn't wire directly into 5V+ and that VIN requires 7V. Anyone doing this?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest