17. APP Control¶
In the previous project we simply viewed the footage taken by the camera and used the AI detection function in the SunFounder Controller.
In this project, we will try to control the movement and direction of the Zeus Car using the joystick widget in the app, so now let’s see how it works.
Note
Please install SunFounder Controller from APP Store(iOS) or Google Play(Android).
How to do?
The ESP32-CAM and the Arduino board share the same RX (receive) and TX (transmit) pins. So, when you’re uploading code, you’ll need to first disconnect the ESP32-CAM to avoid any conflicts or potential issues.
Open the
17_app_control.ino
file under the path ofzeus-car-main\examples\17_app_control
.After the code is uploaded successfully, you can plug in the ESP32-CAM and then slide the power switch to ON to start the Zeus Car.
Toggle the Upload Switch to the side of Run (right side on this diagram) to start the ESP32 CAM.
Press the reset button to get the Arduino board’s program running again.
Connect to
Zeus_Car
WLAN.Find
Zeus_Car
on the WLAN of the mobile phone (tablet), enter the password12345678
and connect to it.
The default connection mode is AP mode. So after you connect, there will be a prompt telling you that there is no Internet access on this WLAN network, please choose to continue connecting.
Create a controller.
To add a controller on SunFounder Controller, click the + icon.
There are preset controllers for some products in the Preset section. But here we choose a Blank and Dual Stick template.
Click the + icon in the J area and select a Switch widget. You may need to slide to the left to see the widget.
Note
If you think you selected the wrong widget, you can click on it again and use the Delete button to remove it.
Run the Controller.
After the “Connected Successfully” message appears, click the button, then the camera footage will appear on the app, and now you can control your Zeus Car with these widgets.
The functions of the three widgets are referenced as follows
Move in All Directions(K)
The Zeus Car will move in the appropriate direction when you swipe the widget.
The car moves once every time you slide, so if you don’t release your hand all the time, the car keeps moving.
Drift Enable(J)
Click the button to enable the drift function.
By sliding the widget counterclockwise, you will see Zeus Car drift to the right. Upon releasing the hand, the car will stop at its current position.
Similarly, if you slide the widget clockwise, the Zeus Car will drift to the left and stop in the current position.
Control the Drection(Q)