我参考了这个示例来实现Android与Arduino板的通信。我使用带有USB盾牌的freeduino uno板和Android手机(micromax A110(4.1.1),sony xperia P(4.0.6)和samsumg core(4.1.2))。我从这里下载了USB_Host_Shield_2.0。我成功编译并上传了sketch,但是无法在freduino uno板和Android手机之间建立通信。我尝试使用freduino uno板的PIN 13闪烁LED,但是它不起作用。连接Android手机到freduino板后,在串行监视器上可以看到输出。
如果我连接Android手机(v4.0.3)与freeduino板,串行监视器会显示以下错误信息。
ADK demo start
Waits for Android device get ready.
Waits for Android device get ready.
Waits for Android device get ready.
Waits for Android device get ready.
Waits for Android device get ready.
ADK Init
ADK Init
ADK protocol rev. 0002
swAcc:
ADK Init
getDevDescr 0D
ADK Init
getDevDescr 0D
ADK Init
getDevDescr 0D
如果我连接Android手机(v4.0.3)与freeduino板,串行监视器会显示以下错误信息。
Device addressed... Requesting device descriptor.
found possible device. swithcing to serial mode
device supports protocol 1 or higher
Data packet error: D
Data packet error: D
Thank you in Advance..