Upload Sketch for BiBoard
This chapter is for Advanced users with programming experience.
1. Read the Quick Start Guide
For the specific parameters of each functional module of BiBoard, please refer to Chapter 2 of the BiBoard Quick Start Guide.
2. Set up BiBoard
2.1 Prepare the ESP32 development environment
Please refer to Chapter 3.2.1 of the BiBoard Quick Start Guide.
2.2 Modify the code file in the package
For Windows: C:\Users\{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.*\tools\sdk\esp32\qio_qspi\include\sdkconfig.h
For Mac: /Users/{username}/Library/Arduino15/packages/esp32/hardware/esp32/2.0.*/tools/sdk/esp32/qio_qspi/include/sdkconfig.h
For Ubuntu: Arduino root directory/.arduino15 (hidden file)/packages/esp32/hardware/esp32/2.0.12/tools/sdk/esp32/qio_qspi/include/sdkconfig.h
Append a line of code at the end of the file:
2.3 Setup the options
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.
2.4 Choose hardware partition
The BiBoard uses an ESP32 with a 16 M 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.
4 MB partition
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".
16 MB partition
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 Add hardware partition configuration option in Arduino IDE.
2.5 Download the OpenCatEsp32 package
We keep updating the codes as an open-source project. You can star and follow our GitHub repository to get the newest features and bug fixes. You can also share your codes with worldwide OpenCatEsp32 users.
Download the OpenCatEsp32 repository from GitHub repository: https://github.com/PetoiCamp/OpenCatEsp32 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.
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).
2.6 Connect to BiBoard via USB type-C data cable
Set the serial port in the Arduino IDE:
If you cannot find the serial port after connecting to your computer:
You may need to install the driver for the CP210x chip.
If the BiBoard is powered on by the battery, please long-press the button on the battery >=3s to power off the mainboard so that the board is only powered through the USB cable and only the blue LED is lit up.
2.7 Compile and upload the sketch
Modify the device type macro definition in OpenCatEsp32.ino according to the device type.
Modify the motherboard model macro definition in OpenCatEsp32.ino according to the motherboard version.
After the modification is completed, you can click the Upload button to upload OpenCatEsp32.ino, and the changes in the program will be automatically saved.
2.8 Swith mode via the serial commands (Optional)
The default code runs the Standard mode (including the Voice command function). If you want to switch modes, Please open the serial monitor and use the following serial commands:
Serial command | Function |
---|---|
XA | Voice. The switch on the extension hat should be dialed to the Voice command side (default mode) |
XU | Ultrasonic. The switch on the extension hat should be dialed to Uart2 side |
XC | Camera |
XL | Light |
XT | Touch |
XI | PIR |
XG | Gesture |
XD | IR distance |
XQ | Quick demo |
X | Disable all the module functions above |
z | RandomMind (On/Off) |
The behavior of the official modules is defined in separate header files in OpenCat/src/. You can find them in OpenCat/src/io.h -> readSignal(). The behavior of Quick demo mode is defined in OpenCat/OpenCat.ino -> quickDemo(). You can study the example code to write your functions.
You can learn about the function of each module through the EXTENSIBLE MODULES.
2.9 Do a factory reset (Optional)
Open the serial monitor, Input the serial command '!', and press Enter to start over. You will see several questions:
Input 'Y' to the question, which means resetting all servo corrections to zero.
If you want to keep the previous joint calibration data, please input 'n'.
Input 'Y' to the question, which means calibrating the MPU6050, i.e. the gyro/accelerometer sensor.
Put the BiBoard FLAT on the table, and don't touch it during calibration.
Sometimes, the program could halt at the connection stage. You can close the serial monitor and reopen it, or press the reset button on BiBoard, to restart the program.
The program starts calibration after playing the melody 6 times.
Input 'n' and press Enter to continue.
The details of serial port printing information are as follows:
After the IMU calibration is completed, the robot will enter the regular power-on program every time it is powered on.
The main program of Bittle judges whether it has been initialized by comparing the BIRTHMARK in the EEPROM and whether it will not enter the initialization process again when it is turned on next time.
2.10 Power on
Long-press the button on the battery and boot up the robot with one side up. It will enter the calibration state automatically. The picture below shows the upper and lower legs installed after the robot enters the calibration state.
Please refer to Chapter 5 🔌 Connect Wires and Chapter 6 📐 Calibration for the complete calibration process.
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).
3. Configuration with App
The BiBoard has built-in Bluetooth, and you can connect it with the new Android app to do joint calibration:
App for BiBoard (Android 4.4+)
You can check the update history and added features in ChangeLog.md (BiBoard\ChangeLog.md)
Last updated