- Home /
Unity to Arduino through Unity App
Hey guys, i've managed to use my keyboard and send serial data to arduino. But, now i'm trying to use a simple app to do the same. But, whenever i change my build settings to Android i get an error saying "The type or namespace name `Ports' does not exist in the namespace" the library is already in there and working on computer. But, not when i switch it to android. Is there anything i can do? Thanks
Answer by Naphier · Mar 02, 2018 at 08:06 PM
Serial ports on Windows are very very different from (virtual) serial ports on Android. How are you connecting your Arduino to your Android device? Setting up USB connection to Arduino is a little difficult on Android (need a special driver). If you're connecting via bluetooth then check out one of the many Arduino bluetooth packages on the asset store.
See also: https://github.com/mik3y/usb-serial-for-android (pretty easy to use for native android apps) Google "unity usb serial android" and you'll find a lot of information on why people don't bother with this and just go with bluetooth (I mean you don't want to be tethered to your Arduino anyway, do you?).
I'm trying to connect my arduino via usb. What kind of driver i need?