arrow-left-lightarrow-leftarrow-right-lightarrow-rightarrow-thin-left arrow-thin-right browser-search cup heart indicator laptop layers layout-4boxes layout-sideleft mail-heart mail map-pin mixer mouse nav paintbucket pencil-ruler phone picture play video

Interface and application programming

  • Week 13

Idea

    I created the following Rubik's cube UI using WebGL and PecilCode music library. You can play with the cubes below. Right click to rotate the cube, and left click to rotate the layers. In the algorithm box below, try the scramble: "URURURURURUR" scramble, and then solution: "R-U-R-U-R-U-R-U-R-U-R-U-"!
    I wanted to use the input from my circuit to control the cubes.

moves will appear here

Implementation

    I used the pySerialto get data from my circuit. In particular, I noted which sides were being turned, i.e. left, right, up, back etc. When the python side received the data, I used the requests library to to do curl commands to save data in firebase. You can see here that we can save data in firebase using put curl commands. This stackoverflow post shows the way to do curl commands using requests library. Then I read the firebase data in the web app to make the cube turn based on the readings from the circuit. Yayy! I was able to make the rubik's cube rotate based on my circuit readings :)

Single large image