Forum.

 

Need help or have a question? Join the conversation in our community topics and share your ideas, tips, or challenges—we’d love to hear from you! Before posting, be sure to check our

 

?

Documentaton of ESP...
 
Notifications
Clear all

[Solved] Documentaton of ESP32 board - Pin Layout

19 Posts
6 Users
1 Reactions
17.4 K Views
Camilo
(@cparrapa)
Developer Admin
Joined: 3 years ago
Posts: 112
 

Hi @merlinmc as you see in previous reply there is no GPIO 5 being used in the main circuit board of Otto.

The RGB lights pin/cable from the ultrasonic sensor that is plug by "default" into the Connector #1 is located in GPIO 18.

But is very important to know these connections are mostly used in the examples and base robot builds therefore they can be interchanged anytime in the code and move around to other connectors.

What are you trying to do I can help you?



   
ReplyQuote
(@merlinmc)
Active Member
Joined: 1 year ago
Posts: 4
 

Thanks, i bought the robot for my child. As i side project i wanna control the robot with a ps4 controller. But i didn't find a solution with micropythen. 

So i'am checking the electronic parts of Otto. The Ultrasonic Sensor HC-SR04 is well documented. But i didn't find much about the sensor with the leds.



   
ReplyQuote
Camilo
(@cparrapa)
Developer Admin
Joined: 3 years ago
Posts: 112
 

@merlinmc thanks to mention that, we will be adding more details to the documentation.

It is hard indeed to find information or code for microPython but for Arduino there re many examples https://github.com/mhmdmrad/PS4-ESP32, and you can always rever back to micropython anytime. Copilot threw this code:

import bluetooth
import time
# Initialize Bluetooth
bt = bluetooth.BLE()
bt.active(True)
# Function to handle incoming data from the PS4 controller
def bt_callback(event, data):
    if event == bluetooth.BLE.GATTC_NOTIFY:
        print("Received data:", data)
# Scan for devices
print("Scanning for devices...")
devices = bt.gap_scan(5000)  # Scan for 5 seconds
for device in devices:
    print("Found device:", device)
# Replace with the MAC address of your PS4 controller
ps4_mac_address = "XX:XX:XX:XX:XX:XX"  # Replace with your controller's MAC address
# Connect to the PS4 controller
print("Connecting to PS4 controller...")
conn_handle = bt.gap_connect(0, ps4_mac_address)
if conn_handle:
    print("Connected to PS4 controller!")
    bt.gattc_write(conn_handle, bt_callback)
    # Keep reading data
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        print("Disconnecting...")
        bt.gap_disconnect(conn_handle)
else:
    print("Failed to connect to PS4 controller.")

mind the indentation

Unfortunately i don't  have a PS4 controller to help you test but let me know how it goes.



   
ReplyQuote
Camilo
(@cparrapa)
Developer Admin
Joined: 3 years ago
Posts: 112
 

@merlinmc Hi we do not use GPIO 5,



   
ReplyQuote
Page 2 / 2
Scroll to Top
This will be available with the release of this product.