Section 3: Setting Up Arduino

You are viewing Section 3 of 13

Now that we know how a stepper motor works, we need program our microcontroller to making it move. 

I have taken the time to write all of the firmware myself. What we will do in this course is examine it line by line so you understand how each part works.

You will then be able to create your own firmware using my example.

Let’s open up the firmware I created in Arduino so we can learn how to program this driver.

If you do not have Arduino installed, please install it now.

And if you do not have the ESP32 board installed for Arduino, please follow these instructions to install the ESP32 board in Arduino.

We will use the ESP32 in because it is very affordable and easy to purchase, but most importantly, it is dual core.

The dual core allow you to run the motor function on one core, and the wifi on the other core without any issues.

That’s how we can use the WiFi at the same time as the motor.

GithubClick here to download the Arduino firmware that we will use.

Let's open up Firmware.ino in the Arduino IDE.

Installing Libraries

Open up the Arduino library manager and install the following libraries 

1) TMCStepper

2) FastAccellStepper

3) ESPUI

4) ArduinoJson

5) LittleFS

LittleFS is more difficult to find. Search for the one like in this image LittleFS_esp32 by lorol.

Extra Dependencies

The ESPUI library has some extra dependencies that need to be installed in a slightly more complicated way. 

  1. https://github.com/me-no-dev/ESPAsyncWebServer
  2. https://github.com/me-no-dev/AsyncTCP


Follow the next steps to install the ESPAsyncWebServer library:

  1. Click here to download the ESPAsyncWebServer library. You should have a .zip folder in your Downloads folder
  2. Unzip the .zip folder and you should get ESPAsyncWebServer-master folder
  3. Open the ESPAsyncWebServer-master folder and you will see another ESPAsyncWebServer-master folder.
  4. Rename this folder from ESPAsyncWebServer-master to ESPAsyncWebServer
  5. Move the ESPAsyncWebServer folder to your Arduino IDE installation libraries folder.

Installing the Async TCP Library for ESP32


The ESPAsyncWebServer library requires the AsyncTCP library to work. Follow the next steps to install that library:

  1. Click here to download the AsyncTCP library. You should have a .zip folder in your Downloads folder
  2. Unzip the .zip folder and you should get AsyncTCP-master folder
  3. Open the AsyncTCP-master folder and you will see another AsyncTCP-master folder
  4. Rename this folder from AsyncTCP-master to AsyncTCP
  5. Move the AsyncTCP folder to your Arduino IDE installation libraries folder
  6. Finally, re-open your Arduino IDE

NEXT SECTION: 4

Course Sections:

Leave a comment