Skip to content Skip to sidebar Skip to footer

Arduino Being Recognized As Keyboard By Android

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() { Seri

Solution 1:

Edit /usr/share/arduino/hardware/arduino/cores/arduino/USBDesc.h, and comment out the line

#define HID_ENABLED

so that it reads instead:

/* #define HID_ENABLED */

This is part of the code that gets compiled into each sketch to enable USB support, and this change will prevent HID support from being compiled into future sketches. You will need to be root or use sudo in order to write your changes to the file. (Is it necessary to restart the Arduino IDE after making this change? Not sure.) On Windows or OS X, you will need to figure out where Arduino's support files are installed and edit the analogous file.

Keywords: Android soft keyboard disabled while Arduino is connected

Solution 2:

I think you have a Leonardo, right?

AFAIK you can not disable the KeyboardEmulation but you could try one of the following:

  • Use a USB -> Serial Cable and use the second Serial Port of your Leonardo
  • If you have a rooted Phone, try to disable the USB Keyboarddriver using adb or a Shell Emulator
  • Modify the Arduino Firmware and remove the Emulation Part (If you have another Arduino to reprogram your Leonardo)

I think thats all you can do.

Solution 3:

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!

Post a Comment for "Arduino Being Recognized As Keyboard By Android"