Upload Sketch for BiBoard
This chapter is for Advanced users with programming experience.
Last updated
Was this helpful?
This chapter is for Advanced users with programming experience.
Last updated
Was this helpful?
For the specific parameters of each functional module of BiBoard, please refer to:
Please refer to of the BiBoard Quick Start Guide.
Append a line of code at the end of the file:
Please refer to the option list to set up the board's upload speed, CPU frequency, etc.
There is a setting for the Flash Size and Partition Scheme among the options. For more information, refer to the next section.
The BiBoard V0 uses an ESP32 with a 16M flash. To simplify, you can use the default 4 MB partition map without a problem. There's plenty of programming space for the standard OpenCatEsp32 firmware.
The BiBoard V1 uses an ESP32 with a 4M flash.
You can use the default 4MB with spiffs. You can also use other partition schemes under the 4 MB flash limit, such as "No OTA" or "Huge APP".
If you download the Zip file of the codes, you will get an OpenCatEsp32-main folder after unzipping. Please rename it to OpenCatEsp32 before opening the OpenCatEsp32.ino so that the two names match.
No matter where you save the folder, the file structure should be:
There are several test***.ino codes in the ModuleTests folder. You can upload them separately to test specific modules (I recommend using testBuzzer.ino as your first test sketch).
Install the libraries:
b. Install ArduinoJson in the Library Manager:
Set the serial port in the Arduino IDE:
Modify the device type macro definition in OpenCatEsp32.ino according to the device type.
if the robot(Bittle X+Arm) with the robotic arm, you should also activate the macro definition as follows:
Otherwise, please comment out this line code.
After the modification is completed, you can click the Upload button (as below) to upload the sketch OpenCatEsp32.ino, and the changes in the code file will be automatically saved.
If the version date of the currently uploaded sketch is newer than the version date of the mainboard firmware, it will automatically enter the initialization startup mode after the sketch upload is completed.
You can check the version date of the currently uploaded sketch in the source code file (OpenCatEsp32/src/OpenCat.h):
#define DATE "250218" // YYMMDD
When the mainboard is powered on, open the serial monitor and you will see the startup information:
Next you will see the following prompt questions:
Send 'Y' to the question, which means resetting all servo corrections to zero.
Send "n" to skip this step.
Send 'Y' to the question, which means calibrating the IMU, i.e. the gyro/accelerometer sensor.
Send "n" to skip this step.
Halts at the connection stage. To restart it, you can close and reopen the serial monitor or press the reset button on BiBoard. Put the BiBoard FLAT on the table, and don't touch it during calibration.
Sometimes, the program halts at the connection stage. To restart it, you can close and reopen the serial monitor or press the reset button on BiBoard.
The program starts calibration after playing the melody 6 times.
Input 'n' and press Enter to continue. Or you can do nothing, it will Auto skip in 5 seconds.
The details of serial port printing information are as follows:
When the string "Ready!" is output in the serial monitor, the program will enter the regular startup mode.
Every time the mainboard is powered on, it compares the BIRTHMARK in the EEPROM to determine whether the program has been initialized. If the program has already been initialized, it will not enter the initialization startup mode again.
The default code runs the Standard mode (including the Voice command function). If you want to switch modes, Please open the serial monitor and send the following serial commands:
XA
Voice. For BiBoard V0, the switch on the extension hat should be dialed to the Voice command side (default mode)
XU
Ultrasonic. For BiBoard V0, the switch on the extension hat should be dialed to the Uart2 side; voice control will not work.
XC
Camera
XL
Light
XT
Touch
XI
PIR
XG
Gesture
XD
IR distance
XQ
Quick demo
XS
Enable the Serial 2(Tx2, Rx2). For BiBoard V0, the switch on the extension hat should be dialed to the Uart2 side; voice control will not work.
XB
Enable the back touch funtion.
X
Disable all the module functions above.
z
RandomMind (On/Off)
Long-press the battery button and boot up the robot with one side up. It will enter the calibration state automatically in the regular startup mode. The picture below shows the head, the upper and lower legs installed after the robot enters the calibration state.
If you power on the robot and it is upright (with its back upward), the robot will start from the "rest" posture (fold the legs and unlock the servos) in the regular startup mode.
Suppose you want to fully utilize the 16 MB flash of BiBoard (it's unnecessary and takes a longer uploading time). You can read the user manual for the .
Download the OpenCatEsp32 repository from GitHub repository: We suggest you utilize GitHub’s version control feature. Otherwise, make sure you download the WHOLE OpenCatEsp32 FOLDER every time. All the codes have to be the same version to work together.
Download and install the into the Arduino IDE.
You need to install for the CP210x chip.
Windows:
Mac:
Modify the motherboard model macro definition in OpenCatEsp32.ino according to the .
Please open the serial monitor and set the configuration parameters of the serial port monitor to 115200 baud rate and No line ending.
You can send the serial command "?" in the serial monitor to check the version date of the mainboard firmware:
You can learn about the function of each module through the .
Please refer to and for the complete calibration process.
The BiBoard has built-in Bluetooth, and you can connect it with the to do and .
You can check the update history information in the .