Fixed the problem of compiling UsbKeyboard in 0018

Hi all,

I've just fixed the problem of compiling the USBKeyboard library.
My approach is simply to modify the header file usbdrv.h.

In usbdrv.h
Add the following statements for usbInit() and usbPoll().

#ifdef __cplusplus
extern "C"{
#endif
USB_PUBLIC void usbInit(void);
#ifdef __cplusplus
} // extern "C"
#endif
#ifdef __cplusplus
extern "C"{
#endif
USB_PUBLIC void usbPoll(void);
#ifdef __cplusplus
} // extern "C"
#endif

And then copy the UsbKeyboard folder to the libraries folder of the arduino enviroment. You may delete the object files (*.o), arduino IDE will compile source code files (including the assembler code). Load and compile (verify) the UsbKeyboardDemo sketch. It should work. :slight_smile:

By the way, the original USBKeyboard library can be found at this ULR Project Log : Arduino USB - ProjectLogArduinoUSB.

\arduino-0018\arduino-0018\libraries\UsbKeyboard/usbdrv.h:18: Error: unknown opcode `usb_public'

\arduino-0018\arduino-0018\libraries\UsbKeyboard/usbdrv.h:25: Error: unknown opcode `usb_public'

Good tip but I still get the errors above using 0018. I've seen some people say just go back and use 0016 but it doesn't run in Win7... ::slight_smile:

EDIT:
Bah silly me, had that above where USB_PUBLIC was defined....

Thanks for that fix - I was having problems with 0018 too, so I've been using 0016 and release 002 of USBKeyboard which works OK.
I've tried moving back to 0018 & release 004 with this fix, and the demo does now compile & upload, but the USB device is unrecognised when I connect it.
I've re-tested the shield with 0016 & 002 & it's fine...

Is there anything else which I need to change / tweak?

Thanks

James

Can anyone upload this USBKeyboard library? The web site doesn't work. :-/

Yeah, I'm having the same issue.

The website simply doesn't work.

What happened to rancidbacon.com?

Apparently it went rancid.

Bump.

Can people post copies of libraries that went poof along with rancidbacon?

Okay, seems like the .tar.gz files were archived.

http://web.archive.org/web/20100811030424/http://code.rancidbacon.com/ProjectLogArduinoUSB

However, I just found this and I don’t have the hardware connected to test it out. How do you apply the patch? Sorry for the noobness, I’ve been running Windows my entire life. Is there a GNU util port of the application to apply patches to a file? :’(

For people who are still following this I have finally updated the library to (a) fix the bug mentioned above and (b) work with the ATmega328.

The library also now has a new home with a public source repository and downloads available:

Hi, I’m having some trouble getting UsbKeyboard to work (Device not recognized).

I’m using version 5 of the library with Arduino IDE 21. I’m using the schematic from http://www.practicalarduino.com/projects/virtual-usb-keyboard . But I’m guessing this schematic may be out of date? The readme says :

"* Build the USB mini-shield documented here:

NOTE: The code will NOW ONLY WORK WITH THE PCB DESIGN
NOT THE PROTOBOARD DESIGN. "

And all of the documentation constantly links this site, which is down -

http://code.rancidbacon.com/ProjectLogArduinoUSB

Does anybody have the PCB schematic? Or any other ideas? (I’m using 0.5w Zeners).

Thanks a lot

I'm having some trouble getting UsbKeyboard to work (Device not recognized).

Have you tried it on a different USB port, different operating system and/or computer?

I'm using version 5 of the library with Arduino IDE 21. I'm using the schematic from practicalarduino.com . But I'm guessing this schematic may be out of date?

No, that schematic should be okay.

And all of the documentation constantly links this site, which is down -

http://code.rancidbacon.com/ProjectLogArduinoUSB

Yeah. :frowning:

--Philip;

Hi,

Thanks a lot for your reply follower, and for letting me know the circuit is the correct one.

I've got it going (resoldered), and I now have a doorbell that sends key presses to my computer :slight_smile:

cheers