SunFounder GalaxyRVR Kit for Arduino, Release 1.0
After fitting the ESP32-CAM to our Rover, we now need to breathe life into it. To do so, we will use the Arduino IDE
to write a program that will control the camera, allow it to connect to WiFi, and stream the visuals it captures.
Here’s how we can do it:
1. Install the SunFounder AI Camera library.
• Open the Arduino IDE’s Library Manager, search for “SunFounder Camera”, and click INSTALL.
• A pop-up window will appear for the installation of library dependencies. Click INSTALL ALL and wait
for the process to complete.
2. In the Arduino IDE, input the following code.
Regarding the variables NAME, TYPE, and PORT in the code, let’s not delve into them at this point.
They will come into play in our next step. Just keep in mind that these variables will be important in
our upcoming journey to establish a real-time video feed from our Mars Rover.
Notice we have two connection modes in the code - AP mode and STA mode. You can decide which
one to use based on your specific needs.
• AP Mode: In this mode, the Rover creates a hotspot (named as GalaxyRVR in our code). This
allows any device like a mobile phone, tablet, or laptop to connect to this network. This is espe-
cially useful when you want to control the Rover remotely under any circumstances. However,
note that this would make your device temporarily unable to connect to the Internet.
84 Chapter 3. Course Mode