本文介绍了如何判断 Android 设备是否具有开放附件模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何检查吗?我刚买了一个三星 Galaxy Tab 2(运行 Android 4.0.3 的 7" 版本),打算用它来连接我的 Arduino Mega ADK 板.但我不确定 Galaxy Tab 是否具有此处列出的必要的开放附件模式:http://developer.android.com/guide/topics/usb/adk.html

Does anyone know how to check for this? I just bought a Samsung Galaxy Tab 2 (7" version running Android 4.0.3) with the intention of using it to connect to my Arduino Mega ADK board. But I am unsure if the galaxy tab has the necessary Open Accessory Mode listed here: http://developer.android.com/guide/topics/usb/adk.html

似乎软件正确并不意味着设备兼容,而且这因制造商而异.由于这是一款新平板电脑,我什么也没找到.有什么帮助吗?

It seems that just because the software is right doesn't mean that the device is compatible and this varies per manufacture. Since this is a new tablet I am not finding anything. Any help?

推荐答案

我不知道你如何知道你的设备是否有这个 ADK 模式(我在尝试设置我的东西时没有尝试遵循那个引导.) 但这里有一些我发现的问题:

I don't know how you can find out if your device has this ADK mode (I failed trying to follow that lead when trying to get my stuff set up.) But here are a few gotchas I figured out:

确保您使用的是 Arduino IDE v1.0,我尝试了 23 一段时间.但是你必须使用newset.

make sure you are using Arduino IDE v1.0, I was trying 23 for a while. But you must use the newset one.

我还必须编辑草图才能使其正常工作.这是我的新设置方法.我只是添加了一些打印语句,这样我就可以知道它在哪个部分失败了.对我来说,结果是 init_joystick ( 5 ); 调用是它死的地方.我对此进行了评论,一切顺利.

I also had to edit the sketch in order to get it working. Here was my new setup method. I just added some print statements so I could tell which portion it was failing at. It turned out for me the init_joystick ( 5 ); call was where it was dying. I commented that out and all went well.

void setup()
{
    Serial.begin(115200);
    Serial.print("\r\nStart");

    init_leds();
        Serial.print("\r\nDone LED");
    init_relays();
        Serial.print("\r\nDone Relay");
    init_buttons();
        Serial.print("\r\nDone button");
    //init_joystick( 5 );


    // autocalibrate OFF
    touch_robot.set_CS_AutocaL_Millis(0xFFFFFFFF);

    servos[0].attach(SERVO1);
    servos[0].write(90);
    servos[1].attach(SERVO2);
    servos[1].write(90);
    servos[2].attach(SERVO3);
    servos[2].write(90);


    b1 = digitalRead(BUTTON1);
    b2 = digitalRead(BUTTON2);
    b3 = digitalRead(BUTTON3);
    //b4 = digitalRead(JOY_SWITCH);
    c = 0;

    acc.powerOn();
        Serial.print("\r\nDone Setup");
}

对 ADK 演示套件草图中的 Setup 方法的这一更改允许注册连接并使应用程序执行其他漂亮的操作.

This change to the Setup method in the ADK demokit sketch allowed the connection to be registered and for the app to do its other nifty things.

但是,我只在我知道支持 ADK 的设备上进行了测试:

However, I only tested on devices that I knew supported the ADK :

  • Galaxy Nexus
  • Nexus S
  • 摩托罗拉 Xoom

您必须为 ADK 设备提供足够的电源 - 当 ADK 设备由 USB 集线器供电时,至少 Nexus S 可能会不稳定.Telltale 迹象是 ADK 模式无缘无故地脱落.

You will have to provide sufficient power to the ADK device - at least Nexus S can be unstable when the ADK device is powered from a USB hub. Telltale signs are ADK mode flaking out for no apparent reason.

这篇关于如何判断 Android 设备是否具有开放附件模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 17:20