Chapter 2 Control 2D and 3D Figures

In this chapter, we will use ESP32 board to make Processing program control figure changes. And we will control 2D and 3D figures, respectively.

Project 2.1 Ellipse

First, control a 2D figure.

Component List

ESP32-WROVER x1

Chapter01_00

GPIO Extension Board x1

Chapter01_01

Breadboard x1

Chapter01_02

Joystick x1

Chapter14_00

Jumper M/M x3

Chapter01_05

Circuit

Use Pin36 and Pin39 (A0 and A3) ports to detect the voltage value of two rotary potentiometers inside joystick.

Schematic diagram

Chapter02_00

Hardware connection

Chapter02_01

Sketch

Sketch Ellipse

Use Processing to open Freenove Ultimate Starter Kit for ESP32CProcessingProcessingEllipseEllipse.pde , then click Run. If the connection succeeds, the following will be shown:

../../../_images/Chapter02_021.png

Then you can change the ellipse shape by shifting the joystick:

../../../_images/Chapter02_031.png

Project 2.2 Box 3D

Now control a 3D figure.

Component list

The same as last section.

Circuit

The same as last section.

Sketch

Sketch Box_3D

Use Processing to open Freenove Ultimate Starter Kit for ESP32CProcessingProcessingBox_3DBox_3D.pde , and click Run. If the connection succeeds, the following will be shown. The left is a 3D box presented by line and the right is a 3D box entity.

../../../_images/Chapter02_041.png

Then you can change the space angle of two 3D box by shifting the joystick:

../../../_images/Chapter02_051.png