简体   繁体   English

Arduino到Android - 使用ADK打开和关闭LED

[英]Arduino to Android – Turning an LED On and Off using ADK

I am referring this example for communicating Android with Arduino board. 我指的是这个例子用于与Arduino板通信Android。 I am having freeduino uno board with USB shield and Android phone(micromax A110 (4.1.1), sony xperia P (4.0.6) and samsumg core (4.1.2)). 我有USB屏蔽和Android手机(micromax A110(4.1.1),sony xperia P(4.0.6)和samsumg core(4.1.2))的freeduino uno board。 I have downloaded USB_Host_Shield_2.0 from here . 我从这里下载了USB_Host_Shield_2.0。 I am compiling sketch and uploading successfully. 我正在编写草图并成功上传。 but, unable to establish communication between freeduino uno board and Android phone. 但是,无法在freeduino uno board和Android手机之间建立通信。 I am trying to blink LED using PIN 13 of freduino uno board but its not working. 我正在尝试使用freduino uno board的PIN 13使LED闪烁,但它无法正常工作。 I am getting output on serial monitor after connecting Android phone to freeduino board. 将Android手机连接到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

If I am connecting Android phone(v4.0.3) with freeduino board i am getting below error on serial monitor 如果我将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.. 先感谢您..

Okay, it could be a few things. 好吧,这可能是一些事情。 For this problem, it might help you to press the reset button a couple of times on the arduino board, then try again. 对于这个问题,它可能会帮助您在arduino板上按几次重置按钮,然后再试一次。 Also, when you connect the shield, try connecting pin d7 to the reset pin on the arduino board. 另外,连接屏蔽层时,请尝试将引脚d7连接到arduino板上的复位引脚。 If this doesn't solve it, then you likely have a problem with your usb shield, but maybe someone else has a better answer for you, let me know if this helps! 如果这不能解决问题,那么你的usb盾可能有问题,但也许其他人有更好的答案给你,让我知道这是否有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM