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 #120 background imageLoading...
Page #120 background image
Need support? support@freenove.com
118
Chapter 11 Touch
www.freenove.com
44
45
46
47
touch_pad_intr_enable();
xTaskCreateUniversal(task_Touch, "task_Touch", 4096, NULL, 1, NULL, 1);
}
Touch sensor thread callback function.
101
102
103
104
105
106
void task_Touch(void *pvParameters) {
Serial.printf("task_Touch is running...\r\n");
while (1) {
task_TouchPad(NULL);
}
}
Touch function threshold setting function. When the sensor is touched, the internal capacitor discharges,
and the data change can be detected at the touch pin. Here, 4/5 of the value of the touch sensor without
contact is set as the threshold trigger range.
3
4
5
6
7
8
9
10
11
static uint32_t s_pad_init_val;
static void tp_example_set_thresholds(void) {
uint16_t touch_value;
// read filtered value
touch_pad_read_filtered(PIN_TOUCH_PAD, &touch_value);
s_pad_init_val = touch_value;
// set interrupt threshold.
touch_pad_set_thresh(PIN_TOUCH_PAD, touch_value * 4 / 5);
}
Touch sensor interrupt trigger function. Execute this function every time the touch sensor is triggered, to set
touchPadVal to true.
12
13
14
15
16
17
18
19
20
21
22
bool touchPadVal = false;
void isr_touchpad(void *arg) {
// uint16_t touchVal = 0;
uint32_t touchStatus = 0;
touchStatus = touch_pad_get_status(); // TOUCHPAD3 : 0000 1000 = 0x08
if (touchStatus == 0x08) // TOUCHPAD3
{
touchPadVal = true;
}
touch_pad_clear_status();
}
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