2010年5月7日 星期五

Fixed the problem of compiling UsbKeyboard in arduino_0018



As we know the original design of USBKeyboard library only works in arduino 0016.

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.



2010年5月3日 星期一