EasyManua.ls Logo

Freenove ESP32 User Manual

Default Icon
159 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #149 background imageLoading...
Page #149 background image
Need support? support@freenove.com
147
Chapter 15 Dog
www.freenove.com
69
70
}
}
Receive commands by BLE.
72
73
74
75
76
77
78
79
80
81
82
83
84
void onBleReceived(BLECharacteristic *pCharacteristic) {
std::string rxValue = pCharacteristic->getValue();
static String bleInputString = "";
if (rxValue.length() > 0) {
for (int i = 0; i < rxValue.length(); i++) {
bleInputString += rxValue[i];
if (rxValue[i] == '\n') {
enterMessageQueue(bleInputString);
bleInputString = "";
}
}
}
}
Receive commands by WiFi.
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
void onWiFiCmdReceived(WiFiClient *client) {
static String wifiInputString = "";
while (client->available()) {
char rv[1024];
int ret = client->read((uint8_t *)rv, sizeof(rv));
for (int i = 0; i < ret; i++) {
wifiInputString += rv[i];
if (rv[i] == '\n') {
Serial.print(wifiInputString);
enterMessageQueue(wifiInputString);
wifiInputString = "";
}
}
}
}
Divide the commands into robot dog action commands and other commands according to the types and
send them into the corresponding message queue.
108
109
110
111
112
113
114
115
116
117
void enterMessageQueue(String msg) {
Serial.print("msg : ");
Serial.print(msg);
switch (msg.charAt(0)) {
case ACTION_INSTALLATION:
case ACTION_CALIBRATE:
case ACTION_UP_DOWN:
case ACTION_BODY_HEIGHT:
case ACTION_MOVE_ANY:
case ACTION_TWIST:
Question and Answer IconNeed help?

Do you have a question about the Freenove ESP32 and is the answer not in the manual?

Freenove ESP32 Specifications

General IconGeneral
Clock Speed240 MHz
RAM520 KB SRAM
Wi-Fi802.11 b/g/n
UART3
Operating Voltage3.3V
Input Voltage5V
DC Current per I/O Pin40mA
USBMicro USB
MicrocontrollerESP32
ChipESP32
BluetoothBluetooth v4.2 BR/EDR and BLE standard
ADC Channels/Analog Input Pins18
I2CYes
SPIYes
InterfacesI2C, SPI, UART
CPUDual-Core 32-bit LX6 Microprocessor

Summary

Safety and Precautions

General Safety Guidelines

Outlines crucial safety measures for handling and using the robot kit to prevent injury or damage.

Hardware Components

ESP32 Expansion Board and Modules

Details the ESP32 expansion board, ESP32 module, camera, and other electronic components.

Mechanical Parts and Tools

Lists acrylic parts, servos, screws, nuts, standoffs, and necessary tools for assembly.

Software and Firmware Setup

CH340 Driver and Firmware Installation

Guides on installing the CH340 driver and burning firmware for OS.

Freenove App and Arduino IDE Setup

Covers installing the Freenove app and setting up the Arduino IDE environment.

ESP32 Pin Configuration

Details ESP32 pins, their functions, and descriptions for robot connectivity.

Robot Assembly and Calibration

Step-by-Step Assembly Guide

Details the process of assembling the robot's body, legs, head, and wiring.

Servo Wiring and Calibration

Guides on connecting ESP32, batteries, servos, and performing robot calibration.

Robot Functionality and Control

Freenove App Features

Overviews app features like Wi-Fi config, LED control, and interaction.

Ultrasonic Ranging and Motion Control

Explains ultrasonic sensor and provides code for robot movements.

Communication Protocols and Commands

Explains communication commands via Serial, BLE, Wi-Fi, and development aspects.

Related product manuals