I have an arduino that controls a car, I need a compass to control the car automatically, unfortunately we could net get a compass (not in stock, no online shopping availble in my country)
So the idea is this:
I will get a compass running on android and feed the data using the USB connection to send a hex data (as a serial connection)
I cann set tx/rx pins on arduino, but i do not know the capabilites of android and whether i can actually manage this..
The idea is simple, get the data from the app and send it through the USB as a serial connection, no need for feed back or anything, just plug in the tx/rx wires coming from the phone into the arduino pins and start receiving. How can I manipulate the USB in such a way? is it even possible?
Searching on google just returns unwanted results like connecting android to PC/ADB/external flash.. thise are not usedul at all.
Yes, I am sure you can do it I frequently use my phone with a usb otg cable. Most new Android phones support usb otg but make sure to check first, not sure about iPhone. I suppose you can also just connect the rx and tx to a mini usb connector and plug that into the phone. I use Serial usb terminal to sent and receive data over the serial usb port. Here is a github app for serial communication you can just modify it to send the compass data.