MENU

Fun & Interesting

Control Motors, Servos and LEDs with a Game Controller & ESP32

Rachel De Barros 28,789 lượt xem 7 months ago
Video Not Working? Fix It Now

Ready to control your robot project with motors, servos, LEDs and more using a game controller paired to an ESP32? Not only will I show you how to wire each of these components to your ESP32, but also how to power servos and DC motors the right way.

Then we'll move on to the Arduino code, where we'll use the Bluepad32 library to make pairing your game controller to the ESP32 as easy as uploading the code and pushing your "pair" button. After that, I'll show you exactly how to use code blocks to assign the actions of each component in your robot project to a button press or joystick movement on your game controller.

In this ESP32 + Game Controller Tutorial:
▶︎ How to wire components like LEDs, servos and DC motors to an ESP32
▶︎ How to provide external power to current-hungry components like servos and motors
▶︎ How to get the values to identify every button and joystick on your game controller
▶︎ How to write Arduino code for each button and joystick on your gamepad to control speed and direction of DC motors, servo positions and turn on LEDs

This ESP32 project builds on a previous tutorial where we learned how to pair a game controller to an ESP32 using the Bluepad32 library:

▶️ Watch Part 1: https://youtu.be/EEViXFoSzww

🔗 Full Tutorial & Code: https://racheldebarros.com/esp32-projects/control-leds-motors-servos-with-a-game-controller-and-esp32/

📬 GET ALL MY ARDUINO CODE & PROJECTS ▶︎ https://racheldebarros.com/newsletter
▶︎▶︎ Subscribe for Arduino Tutorials & Projects Delivered to Your Inbox
- Crystal-clear wiring diagrams
- Copy-paste ready code
- Pro tips for troubleshooting
- Code packs to inspire epic builds

🤖🎨 NEED PERSONALIZED HELP with your project? ▶︎ https://racheldebarros.com/members
▶︎▶︎ JOIN my Engineering Artists Discord Community
- Live Workshops
- Arduino Project Build & Code-alongs
- Small Group Office Hours
- Personalized Project Support

🛒 BUILD YOUR OWN Game Controller with ESP32 Project:
ESP32: https://amzn.to/4cOOfVp
PS4 Game Controller: https://amzn.to/3Tb8Xry
DC Motors: https://amzn.to/4eiiYMj
L298N Motor Driver Module: https://amzn.to/3BmqVl3
Micro Servos: https://amzn.to/3ZC7aA1
6V 2A Power Supply: https://amzn.to/3ZHnAqN
Female DC Jack: https://amzn.to/3ZC8cvT
LEDs: https://amzn.to/4ey7S5K
Resistor (220 Ohm): https://amzn.to/3ZC8iUh
Breadboard: https://amzn.to/4gFlCxf
Jumper Wires: https://amzn.to/4eE24aG

🎬 VIDEO CHAPTERS: Gamepad with ESP32 to control motors, servos & LEDs
0:00 Welcome
0:22 ESP32 30-pin Pinout Diagram
0:32 How to Wire an LED to an ESP32
0:54 How to Wire Servos to an ESP32
1:08 How to Power Servos with External Power Supply
1:34 How to Wire DC Motors to a Motor Driver Module
1:53 Connect Motor Control Wires to the ESP32
3:06 How to Power Motors with External Power Supply
4:16 Intro to the Arduino Code for ESP32 Robot Vehicle Project
9:01 How to Read Gamepad Button & Joystick Values
11:39 Code for Turning LEDs On/Off with Gamepad Button Press
12:29 Code for Controlling Motors with Gamepad Left Joystick
19:09 Code for Controlling 2 Servos with Gamepad Right Joystick
20:19 Testing our Robot Vehicle
21:39 Get the Arduino Robot Vehicle Code
21:46 Join my Community for Live Events & More Code!

💬 Have any questions or want to share your own experiences, tips and advice about pairing game controllers to an ESP32 to control electronic components? Drop a comment below – I love hearing from you!

🔔 If you find this video helpful, please hit that like button 👍 and consider subscribing to my channel for more Arduino/props/robot tutorials, tips, and tricks. Your support helps me create more content like this!

Some links included here are to affiliate sites. If you purchase something through them, I may earn a small commission — which costs you nothing! I am very grateful for your support when you use my links to make a purchase.

#esp32 #esp32project #arduinotutorial #bluepad32 #gamecontrollers #arduinocode #arduinoprogramming #robotvehicles #robotics

Comment