Controling a LEGO NXT robot using an Android device
My ambition is to use the sensors of Android devices to control LEGO robots.
I have made an app called SegOlaWayControl that uses the accelerometer of an Android device to control a NXT LEGO robot with two or three wheels.
The two wheels function is called SegOlaWay Control. To use the two wheels function the NXT robot needs to have a gyro sensor and to be running the LeJOS program SegOlaWay. The SegOlaWay is a self balancing program based on the Segoway code included in the lejos.robotics.navigation package.
The three wheels function is called Direct control and there are no special requirements to run it, just that the NXT needs to be on.
There is also an advanced option where the constants that control the balansing can be modified while running.
The text feald "Knr:" is for selecting konstant.
1 -> kgya, constant for gyro angle
2 -> kgys, constand for angular velosity
3 -> kp, constant for possition
4 -> ks, constant for speed
The text feald Kval: is for modifying the value of the choosen constant.
1.1 -> increment by 10%
0.5 -> reduction by 50%
The code to SegOlaWay and SegOlaWayControl can be downloded by clicking the links in the right panel.
The self balancing robot can use an HiTechnic Gyro Sensor and have the Anyway design. More information can be found at
The project is based on the work found at