Serial usb connection

I don't know if this helps you (or anyone), but I can confirm that the serial component in AI2 does work with an arduino device using an OTG cable. I am able to initialize and open a connection and then send information to the arduino to blink LEDs (HIGH/LOW), etc.

In terms of information transmitted, the arduino (and probably other devices) can convert ascii data into hex/binary/etc upon receiving or before transmission. Not sure about your gamepad if you can't program it.

Re: USB cable occupied, my workflow for this stuff is:

  1. From app inventor, build app to QR code.
  2. Copy the link (it's always the same except for four characters) and download on phone browser and install.
  3. To update, delete app and repeat. USB cable remains attached to serial device.

See this thread for a working .aia:
https://community.appinventor.mit.edu/t/usb-permission-popup-every-time-serial-component/12596

I can provide you with a sample arduino sketch if it interests you, but it seems like you're working with other hardware.

I have not worked with receiving data from serial device yet, only transmitting.

1 Like