You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

1h 21m 3s logged

Completed the code for the bot

Here’s all I did:

  1. Set up BluetoothSerial.h so the robot can connect wirelessly to my phone under the name “Abyss Titan”.

  2. Mapped out the pins for the motor drivers (19, 21, 22, 23) and the RGB LED (25, 26, 27).

  3. Instead of using basic analogWrite, I used the ESP32’s hardware PWM channels (ledcSetup and ledcAttachPin) at 5000Hz to make the motor movements smooth and stop any weird high-pitched whining noises.

  4. Programmed a speed control system: Button 1 sets speed to 120 (Blue LED), Button 2 sets it to 200 (Green LED), and Button 3 triggers Turbo Mode at max 255 speed (Purple LED).

  5. Wrote all the driving functions for full movement: forward, backward, left, right, and stop. Also added diagonal turning functions (forward_right, backward_left, etc.) so the robot can make smoother adjustments while driving.

0
2

Comments 0

No comments yet. Be the first!