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

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 messageIAmOrion wrote: ↑Thu Jun 16, 2016 7:46 amI'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
Download link: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]); } } }
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
I'm using the following codeArduino: 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.
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]);
}
}
}
Arduino version 1.6.5Arduino: 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.
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?voldemortvdk wrote: ↑Sun Aug 21, 2016 5:23 amPlease help, I have the same question.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
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
Users browsing this forum: No registered users and 1 guest