Rubik's Cube Solver

43K25399

Intro: Rubik's Cube Solver

A couple of months ago I finally decided to learn how to solve a Rubik’s cube, and surprisingly it wasn’t as complicated as I thought. I can solve one in a little under 3 minutes, but considering that speedcubers can solve cubes in under 10 seconds 3 minutes seems exceedingly long. While practice does make perfect, spending years improving my cubing skills doesn’t seem that appealing. So, my next best option is to build a machine to solve Rubik’s cubes for me. Let’s build a Rubik’s cube solver!

Check out my Hackaday Page for more info on how I created this project.

STEP 1: 3D Print the Parts

First, let's print the parts. There are 28 needed parts, 19 optional parts, and 14 total STL files. Some parts need to be printed multiple times. The optional parts just add to the visual aesthetic of the solver. Here are the parts

  • stepper_motor_mount_a (x2)
  • stepper_motor_mount_b (x2)
  • cube_adapter_a (x4)
  • cube_adapter_b (x2)
  • base_plate
  • top_stepper_mount
  • bottom_stepper_mount
  • stepper_motor_sleeve (x6)
  • brace (x4)
  • retainer_clip (x4)
  • electronics_plate
  • slot_insert_a (optional x12)
  • slot_insert_b (optional x6)
  • emblem (optional)

I printed all of these parts in PLA filament. I'd recommend using the following printer settings:

  • 20% infill
  • Auto-generated supports
  • PLA (210° extruder and 45° bed)

The weight is about 316g. It took a cumulative 30 hours to print all 28 parts.

STEP 2: Assemble the Frame

First, let's assemble the frame. To do so, we'll first need to mount the four stepper motor mounts onto the base of the frame using the following:

  • M3 x 16mm screws (x8)
  • M3 locknuts (x8)

Next, let's attach the four braces to the frame using the following:

  • M3 x 16mm screws (x12)
  • M3 locknuts (x12)

Refer to the image to see which holes should have screws and which shouldn't. The slot inserts are optional


STEP 3: Add the Stepper Motors

Now we'll add the stepper motors. Hammer each stepper motor sleeve onto the six stepper motors and screw five of the stepper motors onto the frame using (x20) M3 x 8mm screws. The sixth stepper motor mounts onto the top stepper motor mount with (x2) M3 x 8mm screws. The top stepper mount is the removable hat of the machine. In order for it to clip onto the machine you will need to glue 4 neodymium magnets onto the hat and 4 neodymium magnets onto the frame of the machine.

You may be able to get away with pressing the magnets into their slots, but you may need to use gorilla glue to make sure that they don't come out.

STEP 4: Modify the Cube

In order for the Rubik's cube to fit into the machine we'll need to attach the cube adapters to each side of the cube. Make sure your cube is fully solved before doing this then take off the center tiles using an exacto knife. Remember that there are two types of adapters:

  • cube_adapter_a (x4) (this adapter is open on one side)
  • cube_adapter_b (x2) (this adapter is closed on all sides)

Cube adapters b attach to the red and orange sides of the cube. Cube adapter a attach to the blue, green, white, and yellow sides of the cube. Go ahead and label the color of each face on their respective adapter so that you know what the color of the center tile was before you took it off. When the cube is scrambled in the future this is how you will tell which side is which.

Notice the screws under each center tile. This will be used for tensioning the cube later on.

STEP 5: Build the Circuit

Follow the schematic to build the circuit. I spread the electronics across 3 protoboards and mounted them onto a 3D-printed plate.

Bench Power Supply

  • Set it to 24V

5V Regulator

  • The teensy 4.1 and the logic boards on the TMC2208 drivers use 5V. The regulator steps down the 24V to 5V.
  • Connect the positive and negative terminals of the bench power supply to the IN+ and GND pins respectively. The VO+ pin should output 5V once you adjust the voltage using the potentiometer on the regulator and a voltmeter. You can also use fixed output rather than the potentiometer.

Teensy 4.1

  • The teensy 4.1 microcontroller is where the drivers and ethernet kit connect to.
  • You must cut the 5V trace on the teensy that connects the USB 5V to the Teensy 5V. We will power the teensy with the bench power supply using the 5V regulator. This trace to cut is shown in the last image. Double-check that the connection is cut using a multimeter set to test connectivity.

Teensy Ethernet Kit

  • The ethernet kit connects to the teensy and also connects to the LAN port on your router. You will need to assemble the kit by soldering the pins and the capacitor.
  • Teensy 4.1 Ethernet Kit Instructions

Stepper Motors

  • For now, don't connect the steppers to the drivers. This will be done in the next step.

TMC2208 Stepper Motor Drivers

  • The drivers will connect to the teensy and stepper motors. As mentioned, don't connect the stepper motors to the drivers just yet.
  • Set the reference voltage (Vref) of each of the drivers to 0.9V. This sets the current limit of the drivers to 0.64A. Here is a guide on how to do that.
  • The VIO pin on all of the drivers connects to the + terminal of the bench power supply.
  • The GND pin on all of the drivers connects to the - terminal of the bench power supply (there are 2 GND pins on each driver so it doesn't matter which one you use, they are both connected).
  • You will need to add a 100 microfarad capacitor in parallel to the VIO and GND pins on all of the drivers. This is done to prevent voltage spikes from damaging the drivers.
  • This project uses 1/2 micro stepping (400 steps/rev) so you need to connect the MS1 pin to 5V on all of the drivers.
  • The VM pin on the drivers connect to 5V. This powers the logic boards on the drivers.
  • Teensy Pin Assignments:
  • pin 0 connects to the ENA pin on all of the drivers
  • pins 1 and 2 connect to the STEP and DIR pins on driver #1
  • pins 3 and 4 connect to the STEP and DIR pins on driver #2
  • pins 5 and 6 connect to the STEP and DIR pins on driver #3
  • pins 7 and 8 connect to the STEP and DIR pins on driver #4
  • pins 9 and 10 connect to the STEP and DIR pins on driver #5
  • pins 11 and 12 connect to the STEP and DIR pins on driver #6

Make sure that you have a common ground ie all ground pins on all components should be connected.

STEP 6: Assign Stepper Motors

In order for the solver to work properly we need to define each stepper as being either the top, bottom, front, back, right or left stepper and we also need to attach each stepper to its respective driver. Assigning the top and bottom steppers is quite obvious since there is clearly a top and bottom stepper. Assigning the front, back, left and right steppers is completely up to you. Assign one of the steppers as the front and then assign the others based on their location relative to the front stepper. Label the steppers after you assign them. Once this is done, connect the following steppers to the following drivers. Recall the driver assignments that were done in the previous step.

  • Top stepper connects to driver #1
  • Bottom stepper connects to driver #2
  • Front stepper connects to driver #3
  • Back stepper connects to driver #4
  • Left stepper connects to driver #5
  • Right stepper connects to driver #6

These stepper motors have four pins and two phases meaning two pins per phase. These four pins will connect to the M1B, M1A, M2A, M2B pins on each driver (refer to driver diagram in previous step). Two pins of the same phase will connect to the M1A and M1B pins while the two other pins, of the same phase, will connect to the M2A and M2B pins.

  • To determine which two pins are in the same phase, connect any two pins of the stepper motor. If the stepper motor is noticeably harder to turn, then those two pins are of the same phase and the other two pins are of the same phase.

Now connect all the steppers to their respective drivers making sure that pins of the same phase are connected to either M1 or M2 pins. You may have to switch which phase connects to the M1 and M2 pins later. For now, it doesn't matter. Switching this changes the direction of the stepper.

STEP 7: Setting Up the Webserver

I have made a web server to allow the user to set the initial configuration of the cube. This is why we are using ethernet on the Teensy 4.1. You'll need to plug the ethernet kit into a LAN port on your router. Now you need to find your IP address. First, install the three libraries here.

  • AccelStepper library: drives the stepper motors
  • CubeCentral library: displays the webserver
  • CubeSolver library: solves the Rubik's cube

Now download the Arduino sketch below titled Find_IP_Adress and upload it to the Teensy. You should see your IP address printed on the Arduino Serial monitor. Now change the IP address in the sketch to the IP address you just found and reupload. Go to an internet browser and type in the IP address (ex. http://192.168.8.167/) and you should see the Cube Central web server. Right now, none of the buttons will do anything. This is what the buttons will be able to do once we upload the actual sketch (also labeled on the image).

  • Clicking the name of the face will turn that side of the cube and update the cube display.
  • Clicking any tile on the main display (the top left display) will change the color of that tile. This allows you to configure the cube.
  • Clicking the next or prev buttons will allow show you a different side of the cube and allow you to configure it.
  • Clicking the configure button and then refreshing the page will display the total amount of moves it would take to solve the cube in its current configuration.
  • Clicking the start button will solve the physical cube.
  • Clicking the reset button will revert all sides of the cube to their original color.

The web server has misinput prevention If you define a cube configuration that is not possible. Every cube has exactly 9 tiles of every color at any given time. If you define a cube negating this parameter, the start and configure buttons will be unclickable.

STEP 8: Upload the Program

Now it's time to upload the sketch. Download the Cube_Solver Arduino sketch, change the IP address to your IP address, and upload. Now when you go to the web server in your browser the buttons should work. Before you try to solve the cube you need to ensure that each stepper motor turns the right way.

  • Cycle through each face of the cube and click the name of the face to turn that side of the cube. That stepper should turn 90 degrees.
  • Looking from the back of that stepper motor, ensure that the stepper is turning clockwise. If it is turning counterclockwise reverse which phase connects to M1 and M2 on that stepper's driver.
  • Repeat this for all of the steppers.

Now the solver should be ready to solve the cube. Scramble the cube, configure it in the web server, and place it in the solver. You must put the cube into the solver in a specific way.

  • The adapter that you labeled red should be turned by the top stepper
  • The adapter that you labeled orange should be turned by the bottom stepper
  • The adapter that you labeled white should be turned by the front stepper
  • The adapter that you labeled yellow should be turned by the back stepper
  • The adapter that you labeled green should be turned by the right stepper
  • The adapter that you labeled blue should be turned by the left stepper

When you click start, the solver should solve the cube.

In the Arduino sketch, the stepper speed is originally set to 1000 steps/sec. 500 - 1000 steps/sec is a good speed range. Anything outside of this is unpredictable. You can change the speed in the code if you'd like. I have been able to get solves at speeds up to 1380 steps/sec. Try this if you're feeling adventurous!

STEP 9: Common Issues

As the creator of this project trust me when I say that things won't always work the first time. Here are some of the issues that I have experienced.

  • Stepper motor won't turn: Make sure the driver is connected properly. If the other drivers work, then you may have a faulty driver.
  • The cube jams during the solve: First, you may want to tension the cube. The cube should have as little friction as possible. Second, you may want to reduce the speed of the steppers. Third, you may want to try adding the retainer clips that you printed. At slow speeds the retainer clips aren't really needed, but at faster speeds, they may be useful. They fit onto the adapters when you put the cube in the machine and prevent the cube from flexing.
  • The solver runs but doesn't solve the cube: Sometimes the steppers slip and don't turn the cube. If this happens at least once during a solve, then the cube wont be solved. It is essentially missing a step in the solve. This happens occasionally. To prevent this, make sure the cube isn't too loose and consider reducing the speed of the steppers. At 500 steps/rev you rarely ever get slipping.

If your problems persist feel free to reach out to me.

88 Comments

This was probably the best explained Instructable video that I've ever watched! Excellent detail and subtle humour thrown in! Thank you so much for sharing. Keep up your wonderful curiosity! You will go far.
Okay... You might just be a genius.
I am getting errors when I compile the sketch... I haven't used the teensy before, perhaps I have done somthing wrong.


c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:20:29: error: 'String time' redeclared as different kind of entity
20 | String square_type, cursor, time = "00:00", numMoves = "0";
| ^~~~
In file included from C:\Users\doned\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\cores\teensy4/WProgram.h:37,
from C:\Users\doned\AppData\Local\Temp\arduino\sketches\A368C07F7F552CB4FB67CB99C6B041DE/pch/arduino.h:6,
from c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.h:12,
from c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:1:
c:\users\doned\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\time.h:59:12: note: previous declaration 'time_t time(time_t*)'
59 | time_t time (time_t *_timer);
| ^~~~
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp: In member function 'void WebServer::display()':
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:238:52: error: invalid operands of types 'const char [22]' and 'time_t(time_t*)' {aka 'long long int(long long int*)'} to binary 'operator+'
238 | client.println("<mtext>Elapsed Time: " + time + "s</mtext>"); // Web Page Heading
| ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
| | |
| const char [22] time_t(time_t*) {aka long long int(long long int*)}
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp: In member function 'void WebServer::displayTime(String)':
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:334:8: error: assignment of function 'time_t time(time_t*)'
334 | time = new_time;
| ~~~~~^~~~~~~~~~
exit status 1
Compilation error: exit status 1
A brief update; I have the web server running finally. But there is new problem, there is no movement on any of the steppers. The web server seems to be functioning properly all the buttons seem to be working. I can configure the cube and press the start button on the webserver. It calculates the number of moves and time to solve. I can see the results in the serial monitor it seems there is no output to the steppers. I have verified wiring. and tested the motor / drivers circuits with a demo stepper sketch. The motors function properly with the demo code. I will post back once I find a solution.
Are you able to move the steppers individually by clicking the name of each face, front, right etc...? Or is it just the start button that doesn't work?
No nothing moves when I click any of the buttons face, front etc. I do however see the button. pressed messages in the Serial Monitor. I have tested that the motors and drivers are good as mentioned above.
I am finally able to get the motors to run from the server. I had an issue with the driver boards the software is working fine. I had a slight disaster trouble shooting the circuit and shorted the 24v to Gnd so I wiped out all 6 of the drivers. I will up date when it is finished. Thanks for your help along the way.
Good luck. Please do update me. Would love to see a video of it in action!
It is working.... I would have uploaded a video but ran in to file size issue, as I don't have any video editing software I only was able to upload a couple images. I built an enclosure and put the electronics inside. Also replaced the bench power supply with one I could stick inside the box. This was a interesting project and I'm sure I enjoyed it more than the grandson. You did a great job with the design and code. I have since discovered that much of the problems I experienced were ethernet net issues, and found finally that resetting the modem was the answer when it couldn't connect to the server. The obvious thing to do was the last thing on my mind. Thanks for your help.
Awesome job! Glad that you and your grandson enjoyed the build. I too had many issues with the Ethernet connection but I’m glad that you were able to solve them. Your officially the first other person to build this! I would love if you could share your project by clicking the I made it button.
It's hard to tell what the error is by looking at that. As long as you uploaded all of the libraries and didn't change the code everything should work just fine. Are you able to upload an example sketch to your teensy?
Yes I am able to upload example sketches and run them on the Teensy 4.1 I loaded the libraries and got a loaded successful message. However has I haven't changed the code it, I am uncertain what the problem could be. By the way you have done a fantastic
Job creating this project. Thanks for your help.
Sometimes it helps to restart your computer when you upload a new library.
I have tried restarting the computer. I also tried installing the Arduino IDE 2.1 along with the Teensy 1.58.1 board manager on another computer. When I attempt to upload to the teensy there are multiple errors and warnings when it compiles the sketch. I have downloaded loaded the sketches and code libraries an retried but the results are the same. The Libraries install successfully and I can see them in the Arduino IDE. It seems as though the sketches are corrupt.
I found several errors in the Cube Central library i.e. characters that should not have been in the sketch after deleting these there was still an error "time redeclared as a different entity" I am guessing your not using Windows OS. I found there is an issue with windows where file names are not case sensitive, The time.h and Time.h files are considered the same when they are in fact different. A work around is to include a library called TimeLib.h, After including this library in the Cube Central library the IP Finder sketch compiled and the sketch was uploaded to the Teensy. I tried to compile the Cube Solver sketch but it had about 30 errors. as it's getting late I will try the IP Finder tomorrow and also try to correct the errors in the Cube Solver sketch. Has any one else experienced problems with the sketches as posted?
Interesting. I am actually using Windows. Could you send me a screenshot of the errors?
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:20:29: error: 'String time' redeclared as different kind of entity
20 | String square_type, cursor, time = "00:00", numMoves = "0";
| ^~~~
In file included from C:\Users\doned\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\cores\teensy4/WProgram.h:37,
from C:\Users\doned\AppData\Local\Temp\arduino\sketches\A368C07F7F552CB4FB67CB99C6B041DE/pch/arduino.h:6,
from c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.h:12,
from c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:1:
c:\users\doned\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\time.h:59:12: note: previous declaration 'time_t time(time_t*)'
59 | time_t time (time_t *_timer);
| ^~~~
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp: In member function 'void WebServer::display()':
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:238:52: error: invalid operands of types 'const char [22]' and 'time_t(time_t*)' {aka 'long long int(long long int*)'} to binary 'operator+'
238 | client.println("<mtext>Elapsed Time: " + time + "s</mtext>"); // Web Page Heading
| ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
| | |
| const char [22] time_t(time_t*) {aka long long int(long long int*)}
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp: In member function 'void WebServer::displayTime(String)':
c:\Users\doned\OneDrive\Documents\Arduino\libraries\CubeCentral\CubeCentral.cpp:334:8: error: assignment of function 'time_t time(time_t*)'
334 | time = new_time;
| ~~~~~^~~~~~~~~~
Multiple libraries were found for "AccelStepper.h"
Used: C:\Users\doned\OneDrive\Documents\Arduino\libraries\AccelStepper
Not used: C:\Users\doned\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\libraries\AccelStepper
exit status 1

Compilation error: exit status 1
The above is a print out of the errors from the IP Address Finder ino.
This is the errors from the Cube Solver ino.

C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:127:30: warning: missing terminating ' character
127 | void moveStepper(String move)'; {
| ^
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:127:30: error: missing terminating ' character
127 | void moveStepper(String move)'; {
| ^~~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino: In function 'void loop()':
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:51:7: error: 'moveStepper' was not declared in this scope; did you mean 'topStepper'?
51 | moveStepper("U");
| ^~~~~~~~~~~
| topStepper
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino: At global scope:
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:128:3: error: expected initializer before 'int'
128 | int len = move.length(); //the length of the string
| ^~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:129:21: error: 'len' was not declared in this scope
129 | int step = 100 * (len - 4 * (len == 3)); //if (len is 1, step == 100), (len is 2, step == 200), (len is 3, step == -100)
| ^~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:129:32: error: 'len' was not declared in this scope
129 | int step = 100 * (len - 4 * (len == 3)); //if (len is 1, step == 100), (len is 2, step == 200), (len is 3, step == -100)
| ^~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:130:15: error: 'move' was not declared in this scope; did you mean 'std::move'?
130 | char face = move.charAt((len != 1)); //gets the 0th char if move length is 1, gets the 1st char if length is 2 or 3
| ^~~~
| std::move
In file included from c:\users\doned\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\stl_pair.h:59,
from c:\users\doned\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\utility:70,
from C:\Users\doned\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\cores\teensy4/wiring.h:109,
from C:\Users\doned\AppData\Local\Arduino15\packages\teensy\hardware\avr\1.58.1\cores\teensy4/WProgram.h:46,
from C:\Users\doned\AppData\Local\Temp\arduino\sketches\B4B917595F53CC55E61C4D25B9879201\pch\Arduino.h:6:
c:\users\doned\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\c++\11.3.1\bits\move.h:104:5: note: 'std::move' declared here
104 | move(_Tp&& __t) noexcept
| ^~~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:130:28: error: 'len' was not declared in this scope
130 | char face = move.charAt((len != 1)); //gets the 0th char if move length is 1, gets the 1st char if length is 2 or 3
| ^~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:131:3: error: expected unqualified-id before 'switch'
131 | switch (face) {
| ^~~~~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:151:15: error: expected constructor, destructor, or type conversion before '(' token
151 | digitalWrite(ENA, LOW); //sets the drivers on
| ^
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:152:3: error: 'steppers' does not name a type
152 | steppers.moveTo(pos); // Calculates the required speed for all motors
| ^~~~~~~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:153:3: error: 'steppers' does not name a type
153 | steppers.runSpeedToPosition(); // Blocks until all steppers are in position
| ^~~~~~~~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:155:3: error: expected unqualified-id before 'if'
155 | if (CubeCentral.getStatus() != 6) }
| ^~
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:155:37: error: expected declaration before '}' token
155 | if (CubeCentral.getStatus() != 6) }
| ^
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:156:17: error: expected constructor, destructor, or type conversion before '(' token
156 | digitalWrite(ENA, HIGH); //sets the drivers off
| ^
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:158:3: error: expected declaration before '}' token
158 | }
| ^
C:\Users\doned\OneDrive\Documents\Rubik's Cube Solver Robot\Cube_Solver\Cube_Solver.ino:159:1: error: expected declaration before '}' token
159 | }
| ^

exit status 1

Compilation error: missing terminating ' character
More Comments