Solving a Rubik's Cube Using a Single Joystick
Concepts: degrees of freedom, Arduino, Python
No real explanation needed here. I wanted to see if I could solve a rubik's cube using only a single joystick.
Similar to some of my other projects, the high-level idea was to map some foreign controller to keybinds that could be read by the virtual cube online. The challenge here was picking the correct keybinds to accomodate all the degrees of freedom needed.
The joystick I used only had 3 degrees of freedom - two axes of rotation and a click button (which could be held down for two more axes of rotation). With six faces on a Rubik's cube, one could map each direction of the joystick to a single face. However, that's horribly inefficient since wanting to turn a side 90 degrees might mean turning it -270 degrees instead. We can do better.
A Rubik's cube can be solved by turning a single side, IF you're able to orient the cube in the proper position. By allowing two controls for rotating the view of the cube, we can now access every side of the cube with just 3 controls. But with the button being held down, we actually get 8 keybinds at our disposal! To make things more ergonomic then, 4 of the keybinds were used to rotate the top and right sides of the cube clockwise and counter clockwise. The remaining 4 keybinds were used to rotate the view of the cube on two axes, both clockwise or counter clockwise.
It worked surprisingly well!
Similar to some of my other projects, the high-level idea was to map some foreign controller to keybinds that could be read by the virtual cube online. The challenge here was picking the correct keybinds to accomodate all the degrees of freedom needed.
The joystick I used only had 3 degrees of freedom - two axes of rotation and a click button (which could be held down for two more axes of rotation). With six faces on a Rubik's cube, one could map each direction of the joystick to a single face. However, that's horribly inefficient since wanting to turn a side 90 degrees might mean turning it -270 degrees instead. We can do better.
A Rubik's cube can be solved by turning a single side, IF you're able to orient the cube in the proper position. By allowing two controls for rotating the view of the cube, we can now access every side of the cube with just 3 controls. But with the button being held down, we actually get 8 keybinds at our disposal! To make things more ergonomic then, 4 of the keybinds were used to rotate the top and right sides of the cube clockwise and counter clockwise. The remaining 4 keybinds were used to rotate the view of the cube on two axes, both clockwise or counter clockwise.
It worked surprisingly well!