Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arduino Mega ADK 2560与三星Galaxy S2之间的USB通信_Arduino_Galaxy - Fatal编程技术网

Arduino Mega ADK 2560与三星Galaxy S2之间的USB通信

Arduino Mega ADK 2560与三星Galaxy S2之间的USB通信,arduino,galaxy,Arduino,Galaxy,我尝试在Arduino Mega ADK 2560(有两种类型,我使用的是有两个usb端口的型号)和版本为2.3.5(定制)的三星Galaxy S2之间提供usb通信。然而,当我尝试在Arduino的网站上提供的demokit代码时,我总是得到一个错误,即error 5:无法检索设备描述符。请重试。 Demokit代码包括: AndroidAccessory acc("Google, Inc.", "DemoKit", "DemoKit Ard

我尝试在Arduino Mega ADK 2560(有两种类型,我使用的是有两个usb端口的型号)和版本为2.3.5(定制)的三星Galaxy S2之间提供usb通信。然而,当我尝试在Arduino的网站上提供的demokit代码时,我总是得到一个错误,即
error 5:无法检索设备描述符。请重试。

Demokit代码包括:

AndroidAccessory acc("Google, Inc.",
             "DemoKit",
             "DemoKit Arduino Board",
             "1.0",
             "http://www.android.com",
             "0000000012345678");

acc.powerOn();
acc.isConnected();  ---error occurs here!

尽管ADK被后移植到了Android 2.3.4,但许多供应商没有在固件中包含必要的内核修改。我自己很长一段时间都在为同样的问题挣扎。我尝试了不同的2.3.5定制和官方ROM,但找不到可用的内核


ICS不再是问题所在。官方的ICS版本包括具有适当ADK支持的内核。

该行不应该有错误,但是
acc.powerOn()
肯定会抛出错误;这个函数是私有的。使用
begin()
,而不是
powerOn()
。一个引用另一个