UsbSerial Android application exampel fork only, library files not to be updated.
Purpose of repositary is to get a range of input options to an Android application.
Why? , Android devices can only communicate wit USB-devices that exists in the kernals drivers.
However Android devices do accept some USB to serial adaptors, I use a AzDelivery Arduino UNO as adapter.
Whith this I get full access to the Arduino GPIO and the mechanical PS/2 mouse connected to it.
Why a PS/2 mouse? It has 3 directional sensors that can easily be connected to some rotating mechanical thing.
Also it has 3 buttons that you can do stuff with.
Modifications to the original example file so far:
Manifest, added some items to make it remember USB_PERMISSION.
forced single instance as Android otherwise starts a new instance when the Arduino is plugged in.
MainActivity: moved initial focus to the Send-button so that the onscreen keyboard does not hide the Toast-messages.
Current status:
Android application recives from PS/2:
left-right
up-down
scrolldown-scrollup
btnLeft, !btnLeft
btnRight, !btnRight
btnMiddle, !btnMiddle
Arduino accepts commands:
13on, 13off (Onboard led on GPIO 13)
Hardware instructions and original Arduino source at: https://www.instructables.com/Hack-a-Mouse-With-Arduino-2500-Ft-Wireless-PS2/
For information on the library visit the master. Text below is cloned from the master and will be edited/deleted
If UsbSerial helped you with your projects please consider donating a little sum
Or consider buying DroidTerm Pro: A Usb serial port terminal using UsbSerial
CP210X devices Default: 9600,8,1,None,flow off
CDC devices Default 115200,8,1,None,flow off
FTDI devices Default: 9600,8,1,None,flow off
PL2303 devices Default 9600,8,1,None,flow off
CH34x devices Default 9600,8,1,None,flow off
Due to a bug in Android itself, it's highly recommended to not use it with a device running Android 5.1.1 Lollipop. See issue #142 for more details.