如何判断一个Android设备具有打开附件模式 [英] How to tell if an Android device has Open Accessory Mode

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

问题描述

有谁知道如何检查呢?我刚买了一台三星Galaxy Tab 2,使用它的意图(7版本运行的是Android 4.0.3),连接到我的Arduino巨型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 DEMOKIT草图设置方法允许连接到注册和应用程序做它的其他漂亮的东西。

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的可能不稳定。蛛丝马迹都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设备具有打开附件模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆