How to use Android Accelerometer to control a RC car?

28 Views Asked by At

I am working on a personal project which is controlling a car from an Android phone. I want to give the user the possibility to control the car by just tilting the phone, so I have opted to use Sensors, I managed partially to write a code but I do not really understand how sensors change so I couldn't fix the right values where I should take action.

1

There are 1 best solutions below

0
General Tony On

As you use accelometer sensor you can get x and y values using event.values method of onSensorChanged method by that you can calculate current position and last position. And also you can define custom sensitivity for the accelometer. To communicate between RC car and mobile device you can use any network like bluetooth ,wifi or even over LTE & NR. But each network has their own advantages and hardware limitation, So understand your limitation and use the connection type that you want.