SunFounder ESP32 Starter Kit
Code
Note:
• Open the 4.1_motor.ino file under the path of esp32-starter-kit-main\c\codes\4.1_motor.
• After selecting the board (ESP32 Dev Module) and the appropriate port, click the Upload button.
• Always displaying “Unknown COMxx”?
Once the code is successfully uploaded, you will observe the motor rotating clockwise for one second, then counter-
clockwise for one second, followed by a two-second pause. This sequence of actions will continue in an endless loop.
Learn More
In addition to simply making the motor rotate clockwise and counterclockwise, you can also control the speed of the
motor’s rotation by using pulse-width modulation (PWM) on the control pin, as shown below.
Note:
• Open the 4.1_motor_pwm.ino file under the path of esp32-starter-kit-main\c\codes\4.1_motor_pwm.
• After selecting the board (ESP32 Dev Module) and the appropriate port, click the Upload button.
• Always displaying “Unknown COMxx”?
54 Chapter 1. For Arduino User