Upload Sketch for BiBoard
This chapter is for Advanced users with programming experience.

1. Read the user manual

Read the user manual for BiBoard Quick Start Guide.

2. Set up BiBoard

2.1. Add URL in Arduino->Preferences->Additional Boards Manager URLs


2.2. In Boards Manager, search ESP32 and install the 2.0.* version

2.3. Modify code files

Download the BiBoard package from GitHub repo and modify the following files after downloading the BiBoard package:
  • sdkconfig.h

  • For Windows:
  • for Mac:
Append a line of code at the end of the file:
Or replace with BiBoard\ESP32config\sdkconfig.h.
  • esp32-hal-i2c-slave.c

  • For Windows:
C:\Users\{username}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2\cores\esp32\esp32-hal-i2c-slave.c with the file in this folder (BiBoard\ESP32config\esp32-hal-i2c-slave.c).
  • For Mac:
Replace with BiBoard\ESP32config\esp32-hal-i2c-slave.c.

2.4. Add hardware partition

2.5. Compile and upload the sketch

Modify the device type macro definition in BiBoard.ino according to the device type.
#define BITTLE //Petoi 9 DOF robot dog: 1 on head + 8 on leg
//#define NYBBLE //Petoi 11 DOF robot cat: 2 on head + 1 on tail + 8 on leg
//#define CUB
Modify the motherboard model macro definition in BiBoard.ino according to the motherboard model.
#define BiBoard //ESP32 Board with 12 channels of built-in PWM for joints
//#define BiBoard2 //ESP32 Board with 16 channels of PCA9685 PWM for joints
After the modification is completed, you can click the upload button to upload BiBoard.ino, and the changes in the program will be automatically saved.

2.6. Initialization

When the newly set BiBoard is powered on, it needs to connect the serial port to the computer, and initialize the joint and gyroscope accelerometer (IMU) in the serial port monitor window.
Make sure to set the serial monitor as 115200 baud rate and no line ending.
You will see several questions:
Reset the joints' calibration offsets? (Y/n):
Type ‘Y’ to the question, which means resetting all servo corrections to zero.
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n):
Type ‘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.
The details of serial port printing information are as follows:
* Start *
Scanning I2C network...
- I2C device found at address 0x54 !
- I2C device found at address 0x68 !
- done
Set up the new board...
// The device name to use when connecting with bluetooth
- Name the new robot as: BittleED
Reset the joints' calibration offsets? (Y/n):
Initializing MPU...
- Testing MPU connections...attempt 0
- MPU6050 connection successful
- Initializing DMP...
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n):
Put the robot FLAT on the table and don't touch it during calibration.
- Calibrating the Inertial Measurement Unit (IMU)...
MPU offsets:
// X Accel Y Accel Z Accel X Gyro Y Gyro Z Gyro
//OFFSETS 3752, -968, 942, 170, 76, 21
- Enabling DMP...
- Enabling interrupt detection (Arduino external interrupt 26)...
- DMP ready! Waiting for the first interrupt...
Bluetooth name: BittleED
Waiting for a client connection to notify...
Setup ESP32 PWM servo driver...
After the IMU calibration is completed, every time the robot is powered on, it will enter the regular power-on program.
The main program of Bittle judges whether it has been initialized by comparing the BIRTHMARK in the EEPROM, and will not enter the initialization process again when it is turned on next time.
If you need to recalibrate the servo offsets or recalibrate the IMU (MPU6050), you can enter 'R' in the serial monitor to start over.

2.7. Power on

  • long-press the button which is 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 legs and lower legs installed after the robot enters the calibration state.
Although the BiBoard has only 12 pins, the joint index numbers are configured in the same order as the NyBoard. The connection between the joint servo and the pin is shown in the figure below:
Please refer to 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).

2.8. Configuration with App

The BiBoard has built-in Bluetooth and you can connect it with the new Android app:
You can check the update history and added features in ChangeLog.md (BiBoard\ChangeLog.md)