Welcome to ESP32 WiFi Camera Lite repository
Microbit
Microbit configure camera
1. Experimental preparation
- Module World Extension Board
- Microbit
- WIFI camera
2. Experiment wiring
| Extended Board | ESP32 Camera |
|---|---|
| P16 | RX |
| P15 | TX |
| GND | GND |
| 5V | 5V |

The physical connection chart:

3. Microbit's building block import and simple description
3.1 Open the programming website
https://makecode.microbit.org/#
3.2 New project

3.3 Add the block of the camera

URL of the blocks:
https://github.com/YahboomTechnology/ESP32-wifi-Microbit.git

3.4 Introduction to the main building block
After successfully introducing the block block above, the result will be displayed as shown in the figure below

- serial port initialization of the building block This is a pin used to define serial communication and communicate with the WiFi camera. The baud rate is 115200.

- Set the size of the serial port receive buffer This block is used to define the size of a packet of data that can be accepted for transparent transmission, such as

This defines that the maximum size of a packet is 30 characters. Exceeding this value will result in incomplete data reception. This value cannot be less than 25, otherwise the IP information will also be incomplete
- You can know the function of other building blocks by looking at their names. For how to use them, you can look at the source code provided in this tutorial. This tutorial will not explain how to open the source code provided in the tutorial
- Browser open the URL https://makecode.microbit.org/#
- Then drag the Hex file provided by this experiment into the browser that opens the URL, and it will automatically open
- Procedure diagram of the source code of this project

4. Experimental operation and experimental effect
- According to the source code, Microbit first initializes the serial port, and then configures the working mode of the WIFI camera.
- Then according to the setting of wifs to be connected

The wifi here needs to be changed to a connected wifi
- If the connection is successful, microbit will display sta_ip:192.168.x.x address. If the connection is unsuccessful, it will display sta_ip:null. If it is only configured as the self-heating point mode, it is also impossible to find the IP address of sta_ip, and it will also display the result of sta_ip:null.
- This is the configuration of spontaneous hot spots

If the configuration is successful, the mobile phone can receive the microbit_wifi wifi hotspot, and can connect to the wifi by configuring a password or without a password, and the microbit will display the ip "ap_ip:192.168.4.1". If this name cannot be found, check whether it is configured to connect to wifi only (the mode shown in the figure below), and the microbit will display the information "ap_ip:null"
- Set AI mode, there are 5 AI modes in total, here are set as cat and dog mode. If you want to use that mode to set up that mode

- Download the program, you can directly pull the source code to the Hex file into the identified Microbit disk. You can also click to download the webpage

After downloading, Microbit displays the sta_ip address and AP_IP address. Finally, a √ symbol is the successful download.

- Open the camera and connect to the hotspot published by ESP32 (you can also use the STA_IP address to log in directly)

Then enter http://192.168.4.1:81/stream this access camera screen

- Recognize cats and dogs. The successful recognition will print out the current central coordinates and put the cat's picture in front of the screen just now.

Microbit dot matrix will circulate the X coordinates and Y coordinates selected by the box,

Color detection mode, face detection
When switching to color recognition mode,

Download the program, you can directly pull the source code to the hex file into the identified Microbit disk. You can also click to download the webpage

Recognize color. Press the button to appear a box, you can use this box to frame the color you want to use.

Press and press the key for two seconds, let go and press it again to identify the color selected by the current box, and the red box appears at the same time.

The X -coordinate and Y coordinates selected by the Microbit dot matrix will be displayed in the box.
QR code detection mode
When switching to color recognition mode,

Unlimited circulation modification to direct output transmission data

Download the program, you can directly pull the source code to the hex file into the identified Microbit disk. You can also click to download the webpage

Searching the QR code generator with a mobile WeChat Mini Program, which belongs to the relative text, will generate a QR code and save it to the album. Below is identifying the QR code.

Microbit points are printed on the identified text.
Face recognition mode
When switching the adult face recognition mode,

Unlimited cycle modification is modified, read face recognition data, and then directly output transmission data

Download the program, you can directly pull the source code to the hex file into the identified Microbit disk. You can also click to download the webpage

Recognize the face. When you don't get the face, press the key button to indicate the face of the face

The picture below appears that the record is successful, and the record is a face 1

At this time, you can press and press the key for two seconds, and then release the key to recognize the current face.

Microbit will print central coordinates and faces recognized.