I needed a better way of entering the cube state than directly typing them into the Arduino sketch, so I got the idea of creating a GUI from this robot: īecause I’m new to making Tkinter GUI’s (Graphical user interface) and didn’t want to make one from scratch, I found a tic tac toe GUI here. This way, the program can simulate the cube move before it physically executes it. The program reassigns the values in the arrays to simulate and cube rotation. One major breakthrough I had was that I actually simulated the cube’s movements in the program.
#Rubiks cube timer kit diy code#
Here’s a basic overview of the code structure (layers of abstraction):Ĭube Decide functions < Cube Algorithms < Cube Move functions < Servo functions < Move Function The cube notation and algorithms control the servo functions, such as push_cube() or rotate_one(). Within each stage, such as cube_decide_cross() (solving the cross), the program would check for specific locations of colours in the cube, and if an algorithm was matched with the condition, cube notation like ‘U’ (Up) or entire algorithms, like fix_cross_instance_1() would be run.Ĥ. Using a basic layer by layer method of solving the Rubik’s cube, I made a function, cube_decide(), that goes through each stage or the cube solving process.ģ. There are 6 char arrays represent each face of the cube.Ģ. It basically uses algorithms to manipulate the cube colours:ġ.
#Rubiks cube timer kit diy serial#
There are 3 main parts of my code: the algortihm, GUI (enter cube state) and the serial communications So basically the code I wrote uses combinations of pushes, holds and platform rotations to apply algorithms to the cube. Honestly building the physical solver was a lot harder and complex than I expected, so if you have any questions on how I built the solver, just ask. – Glued wooden wheels that act as washers on each end. – I drilled a hole into ends of the popsicle sticks. Slanted sticks to prevent the cube from snagging. I haven’t documented every step of the build process, but I think you can reproduce the tilted twister design with a few tweaks:ġ. When I first tried to build the solver, I tried to follow building instructions here:īut I was pretty lazy and didn’t follow the instructions, so I made a wooden replica with a few tweaks. So here’s how the mechanism basically works:ġ.
![rubiks cube timer kit diy rubiks cube timer kit diy](https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/rubiks-cube-toy-on-black-background-with-reflection-news-photo-1576514934.jpg)
![rubiks cube timer kit diy rubiks cube timer kit diy](https://teachyourkidscode.com/wp-content/uploads/2020/12/Rubik_s-Cube-Coding-Activity.jpg)
Basically how the code works is if the gyro reads over a certain angle, a flip is recorded and 10 is added to the respective R B G value.I looked at a few designs but settled on the Tilted Twister because it only required 2 servos to operate, which wasn’t as complex mechanically as other robots such as the Cubestormer. This is why you need a filter to help with the drift and get more accurate angle readings. I learned very quick that the accelerometer and gyro from the nano is really bad and the values drift all over the place. I used the code from this file to read and filter gyro and accelerometer data.
![rubiks cube timer kit diy rubiks cube timer kit diy](https://inteng-storage.s3.amazonaws.com/img/iea/3ROax9BKwv/rubiks-cube-pieces1.jpg)
Step 5: Codeįirst want to say thank you to on github for his gyro and accelerometer code.
![rubiks cube timer kit diy rubiks cube timer kit diy](https://us03-imgcdn.ymcart.com/53231/2020/05/19/b/7/b7f7a28ce626be2c.jpg)
I also hot glued the whole housing to the deck because the plastic can break off with the hard impacts of skateboarding. The housing is sandwiched between the truck and the deck. please note this file is far from perfect and needs revisions and modifications to make the electronics fit. The file attached is the housing for the electronics.