我正在尝试使用 arduino ADK 板http://arduino.cc/en/Main/ArduinoBoardADK和运行 android 2.3.4 的索尼爱立信 Xperia Play 制作一个项目。对于初学者来说,我想做的就是从我的安卓设备上闪烁一个 LED,使用这里找到的很好的教程http://allaboutee.com/2011/12/31/arduino-adk-board-blink-an-led-with- your-phone-code-and-explanation/。我设法编译了 android 应用程序,但我在 arduino 草图上遇到了很大的困难,我无法解决导入问题,它也无法在 Windows7 上编译。我知道有一些 arduino IDE 版本问题。我尝试在 0022、0023 和 1.0 上编译。在编辑以下代码后,我可以尽最大努力得到这些编译错误AndroidAccessory.h
:
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:37: error: 'EP_RECORD' does not name a type
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:50: error: 'EP_RECORD' has not been declared
D:\arduino-0023\libraries\AndroidAccessory/AndroidAccessory.h:64: error: 'USB_NAK_LIMIT' was not declared in this scope
我想我阅读了整个文档,但找不到解决问题的方法。设置它是如此痛苦......我真的需要完成这项工作。先感谢您!:)
-------------------------------------------------- -------------------------------------------------- ----------------------
EDIT1:对我有用的解决方案是在 Linux(Ubuntu)上编译草图
-------------------------------------------------- -------------------------------------------------- ----------------------
EDIT2:再次使用来自arduino 网站的最新 USB 库,代码无法编译。我尝试在运行 Windows 8 和 Ubuntu 12.10 的 IDE v22 和 v1.0.2 上进行编译,但出现以下错误:
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h: In function 'void setup()':
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h:68: error: 'void AndroidAccessory::powerOn()' is private
sketch_jan10a:16: error: within this context
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h: In function 'void loop()':
E:\Development\arduino-1.0.2\libraries\UsbHost/AndroidAccessory.h:66: error: 'int AndroidAccessory::read(void*, int, unsigned int)' is private
sketch_jan10a:23: error: within this context