Robot App Store

image description

Tilted TwisterRobot-App Page

App Price:
Relevant Robots:
  • LEGO - Mindstorms NXT 2.0
Tilted Twister
Release Date:
App Version:
App Size:
See all requirements...

Robot App™ Description


  • Solves a standard Rubik's cube  No need to replace any color stickers

  • Can be built from a single LEGO Mindstorms NXT 2.0 set

  • Completely stand-alone  No need to connect a computer

  • No web cam needed  It detects the colors using the LEGO Mindstorms color sensor

  • Support for Herbert Kociemba's Two-Phase Algorithm

  • Free programs and building instructions

Color recognition

Even if the LEGO Mindstorms color sensor is very accurate, it is hard to distinguish between the red and the orange colors. The corners are no problem. There is redundancy in that it is possible to use the colors of two sides to determine the color of the third. The center cubies have even more redundancy. The only thing I had to consider was the Rubik's logo on the white center cubie, which gives undefined color readings. The edge pieces are hardest to resolve. For example to determine whether an instance of a cubie is red/blue or orange/blue.

Calculating a solution

I have implemented a corners-first method which generates a reasonably short solution. The average is about 60 face turns (which I think is pretty good for a general solution). As a matter of fact, the program calculates three solutions with different starting points, and picks the shortest.

Herbert Kociemba's Two-Phase algorithm

To get an even quicker solve, it is possible to connect Tilted Twister to a computer via Bluetooth to calculate a shorter solution. I have used Herbert Kociemba's fantastic Two-Phase algorithm which I use in a Java Application. This produces a solution of typically 21 face turns in just a second.



  • Scanning the cube: 45 seconds

  • Calculating a solution: 20 - 40 seconds

  • Executing the moves: 1 - 5 minutes

  • Average total time: 6 minutes

Connected to computer:

  • Scanning the cube: 45 seconds

  • Calculating a solution: 1 second

  • Executing the moves: 1 - 2 minutes

  • Average total time: 2.5 minutes

Installation Instructions

Delivered as:


1 - Color sensor
2 - Ultrasonic sensor
A - Turntable motor
B - Tilter arm motor
C - Color sensor motor

Downloading files to the brick

Download the files in to the brick.
The files can be downloaded to the brick using the lego mindstorms software:

  • Unzip to a new directory.
  • Create a new project (File/New)
  • Press the button "NXT window"
  • Select the Memory tab
  • Press the download button

If you are having problems downloading, try to delete other program files and sound files etc to make room.

Rubik's cube

Tilted Twister 2.0 is programmed to solve a standard Rubik's cube. The Rubik's Logo on the white face is taken into account by the program. The program works best if the cube is loose. If your cube is very stiff, you could try lubricating it with silicone spray. After lubrication, work the cube for a few minutes.

Tilted Twister Java Application

If you are able to connect your LEGO Mindstorms brick to a computer via Bluetooth, you can use the Java Application tiltedtwister.jar to let your computer calculate a faster solution.

Source Code

You don't need the source code (.nxc) unless you want to modify it.
The program is written in NXC using Bricx Command Center. It cannot be edited or viewed in the LEGO Mindstorms software. (It can be viewed in notepad)
And java application source code is also included in the downloaded file.


Robot App Requirements


1. LEGO Mindstorms software.
2. Bricx Command Center. (If you want to modify the NXC code)

1. Standard LEGO Mindstorms NXT 2.0 set. (#8547)
2. A USB cable or bluetooth connection.
Other requirements:

A Standard Rubik's Cube.

Usage Instructions

First make sure you have followed the building instructions correctly.

The robot performs the following steps:

1: Wait for a cube to solve.

The display should read "GIVE ME A CUBE".
The ultrasonic detector detects when you put the cube in the cradle.
It says Thank you and writes "THANK YOU !" on the display, and moves on to the next step.
If the ultrasonic sensor by any reason does not detect the cube, you could press the orange center button to continue.

2: It scans all six sides

(it will tilt the cube 5 times).

3: It resolves the colors.

The display reads "RESOLVING COLORS" and after a few seconds it will read "Center colors...", "Corner colors..." and last "Edge colors...".
If it failed resolving the colors it will say Sorry and the diaply will read "SORRY Can't resolve colors".
If this is the case it could be caused by incorrect position of the color sensor. Try to move the sensor a bit up or down.
It could also be caused by an incorrect cube. If you have dismantled a cube and assembled i again, it may be unsolvable.
Or if you have a cube that is not an original Rubik's cube.

4: It calculates a solution.

In fact it calculates three solutions and picks the shortest.
The display should read "SOLVING Solution 1" and it plays short beeps with increasing pitch while it calculates the solution.
After a few seconds it should do the same for "SOLVING Solution 2" and "SOLVING Solution 3".

5: It executes the moves by turning, twisting and tilting the cube

when it's done it says "Game Over".

Are you a robot-apps developer?

Joining the developer program is easy and FREE!