Arduino被android识别为键盘

Arduino被android识别为键盘

本文介绍了Arduino被android识别为键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 arduino 编写了一个简单的固件,以将它从串行接收到的任何传入数据复制到串行输出.像这样的东西:int serialData = 0;

I wrote a simple firmware for arduino to replicate whatever incoming data it recieves on serial to the serial output. Something like this:int serialData = 0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0)
  {
    serialData = Serial.read();
    Serial.println(serialData);
  }
}

现在我希望它使用 microUSB->OTG 电缆 + USB->microUSB 电缆连接到我在 Android 4.3 上运行的 Nexus 7.我安装了一个串行监视器应用程序(https://play.google.com/store/apps/details?id=jp.ksskue.app.terminal&hl=en) 并希望通过它写入串行数据.

Now I wanted it connect to my Nexus 7 running on Android 4.3 using a microUSB->OTG cable + USB->microUSB cable. I installed a serial monitor app (https://play.google.com/store/apps/details?id=jp.ksksue.app.terminal&hl=en) and was expecting to write serial data over it.

将其连接到平板电脑后,我最终收到了键盘通知.Android 将此连接识别为键盘.这会折叠 android 键盘,因为它已检测到外部键盘.但是我可以选择粘贴到输入框上.这似乎有效.

Once I connected this to the tablet I ended up getting a keyboard notification. Android recognizes this connection as keyboard. This collapses the android keyboard as it has detected an external keyboard. however I get an option to paste on the input box. Which seems to work.

有没有可能

  • 禁止在 android 中安装键盘.或者
  • 让 arduino 被识别为键盘以外的东西.

推荐答案

此问题的解决方法是安装另一个键盘应用程序,如 Go 键盘或 swype.这会导致在将 arduinp 连接到 android 设备时发出通知,您可以从那里关闭外部硬件并重新打开屏幕键盘.不持久但有效!

A workaround to this problem was to install another keyboard app like Go keyboard or swype. This leads to a notification upon connecting arduinp to the android device, from where you can turn off the external hardware and switch back on screen keyboard. Not persistent but works!

这篇关于Arduino被android识别为键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 17:48