Petoi Doc Center
🇺🇸English
🇺🇸English
  • Welcome to Petoi Doc Center
  • Getting Started Guide
  • 🙋‍♂️FAQ(Frequently Asked Questions)
  • Petoi robot joint index
    • Joint Pins on NyBoard
      • Nybble
      • Bittle
    • Joint Pins on BiBoard V0
      • Bittle X
      • Bittle X+Arm
    • Joint Pins on BiBoard V1
      • Bittle X
      • Bittle X+Arm
      • Nybble Q
  • Bluetooth Connection
    • BiBoard
    • NyBoard
  • Upload Firmware
    • NyBoard
    • BiBoard V0
    • BiBoard V1
  • Joint Calibration
  • Infrared Remote
    • Remote Controller
  • Mobile App
    • Introduction
    • Calibrator
      • Nybble
      • Bittle
    • Controller
  • Desktop APP
    • Introduction
    • Firmware Uploader
      • NyBoard
      • BiBoard V0
      • BiBoard V1
    • Joint Calibrator
      • NyBoard Preparation
      • BiBoard Preparation
      • Nybble
      • Bittle / Bittle X
        • Bittle (NyBoard)
        • Bittle X (BiBoard V0)
        • Bittle X (BiBoard V1)
      • Bittle X+Arm
        • BiBoard V1
        • BiBoard V0
    • Skill Composer
      • NyBoard Connection
      • BiBoard Connection
      • Interface
        • Nybble
        • Bittle / Bittle X
        • Bittle X+Arm
    • Tools
  • Block-based programming
    • Petoi Coding Blocks
      • NyBoard Preparation
      • BiBoard Preparation
    • Block-based Coding Curriculum - Learn Quadruped Robotics for Beginners
    • Python coding mode in Mind+
    • Generic Arduino Uno Blocks
    • Install Mind+ on Chromebook
  • Arduino IDE
    • Upload Sketch for NyBoard
    • Upload Sketch for BiBoard
    • Calibrate the joints with Arduino IDE
    • Serial Monitor
    • C++ Curriculum: Learn Quadruped Robotics for Beginners
    • Install Arduino IDE on Chromebook
  • Free Curriculum
    • 📚Download
  • APIs
    • 🖇️Serial Protocol
      • Feedback servos
      • Nested task queue and signal generator
    • 🐍Python API
    • 🐛8266 MicroPython controller
      • Run MicroPython on ESP8266
      • Setup WebREPL
      • Using the ESP-NOW protocol
    • 🦎8266 Arduino C Controller
    • ©️C++ API
    • 🍓Raspberry Pi serial port as an interface
      • For BiBoard V1
    • 💻Set up Development Environment on Chromebook
    • 🤖ROS
  • Nyboard
    • Overview
    • NyBoard V1_0
    • NyBoard V1_1 & NyBoard V1_2
  • BIBOARD
    • BiBoard V0 Guide
    • BiBoard Extension Hat
    • Demo Applications
      • 1.GPIO port
      • 2.Serial port
      • 3.Analog-digital converter
      • 4.Digital-Analog Converter
      • 5.EEPROM (Electrically Erasable Programmable read only memory)
      • 6.Gyro IMU(MPU6050)
      • 7.Infrared remote control
      • 8.PWM(Pulse Width Modulation)
      • 9.Servo(under construction)
      • 10.Classic Bluetooth serial port SPP
      • 11.Bluetooth low energy (BLE) serial port pass-through
      • 12.File system SPIFFS
      • 13.Add hardware partition configuration option in Arduino IDE
      • 14.Play MP3
      • 15.The usage of Wi-Fi OTA(Over-The-Air)
    • BiBoard V1 Guide
  • Communication Modules
    • Introduction (For NyBoard)
    • USB Uploader (CH340C or CH343G)
    • Dual Mode Bluetooth
    • WiFi module ESP8266
      • ESP8266 + Python Scripts Implement wireless crowd control
  • Extensible Modules
    • Introduction
    • MU Camera
    • Ultrasonic Sensor
    • Light Sensor
    • Touch Sensor
    • Gesture Sensor
    • PIR Motion Sensor
    • IR Distance Sensor
    • Voice Command Module
    • Petoi AI Vision Module
    • Advanced development and application of AI vision modules
      • Model Training
      • Model quantification
      • Model deployment
      • Training on the COCO DIY dataset
    • Robot Arm
      • Upgrade your older Bittle/Bittle X for the robotics arm gripper
    • 🎮Joystick with Micro:Bit
  • Applications
    • Melody Creation
    • Skill Creation
    • OpenCat Imitation Tutorial
    • Programmable Puppet Character
    • Tutorial for simulating Bittle In Isaac Sim
  • History
    • Upload Sketch For NyBoard (software 1.0)
  • Technical Support
    • 💾Supporting Application and Software
    • 🔧Burn Bootloader for NyBoard
    • 🛠️Useful Tools
    • 🔋Battery
  • Useful Links 🕸
    • 🔭Home of Petoi Robots
    • 🛒Shop Coding Robots
    • 💿GitHub of OpenCat
    • 🎪PetoiCamp (Forum)
    • 📽️Petoi Robot Videos
    • 📬Users' repositories
Powered by GitBook
On this page
  • 1. Read the Quick Start Guide
  • 2. Set up BiBoard
  • 2.1 Prepare the ESP32 development environment
  • 2.2 Modify the code file in the package
  • 2.3 Setup the options
  • 2.4 Choose hardware partition
  • 2.5 Download the source code & install the library
  • 2.6 Connect to BiBoard via USB type-C data cable
  • 2.7 Compile and upload the sketch
  • 2.8 Program Initialization
  • 2.9 Swith working mode via the serial commands (Optional)
  • 2.10 Power on
  • 3. Configuration with App

Was this helpful?

Export as PDF
  1. Arduino IDE

Upload Sketch for BiBoard

This chapter is for Advanced users with programming experience.

PreviousUpload Sketch for NyBoardNextCalibrate the joints with Arduino IDE

Last updated 25 days ago

Was this helpful?

1. Read the Quick Start Guide

For the specific parameters of each functional module of BiBoard, please refer to:

2. Set up BiBoard

2.1 Prepare the ESP32 development environment

Please refer to of the BiBoard Quick Start Guide.

2.2 Modify the code file in the package

  • sdkconfig.h

  • 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:

#define CONFIG_DISABLE_HAL_LOCKS 1

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 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.

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

2.5 Download the source code & install the library

We keep updating the codes as an open-source project. You can star-mark and follow our GitHub repository to get the newest features and bug fixes. You can also share your codes with worldwide OpenCatEsp32 users.

  1. 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).

  1. Install the libraries:

    b. Install ArduinoJson in the Library Manager:

Set the serial port in the Arduino IDE:

If you cannot find the serial port after connecting to your computer:

  • for BiBoard V0:

  • For BiBoard V1:

    You need to install the driver as below:

  • If the battery powers on the BiBoard, please long-press the button on the battery >=3s to power off the BiBoard, so that the BiBoard 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.

#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
// #define BiBoard_V0_1  //ESP32 Board with 12 channels of built-in PWM for joints
#define BiBoard_V0_2
// #define BiBoard_V1_0

if the robot(Bittle X+Arm) with the robotic arm, you should also activate the macro definition as follows:

#define ROBOT_ARM                 // for attaching head clip arm

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.

2.8 Program Initialization

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:

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
k
Flush the serial buffer...

* Start *
Bittle X
Software version: B02_250121
Scanning I2C network...
- I2C device found at address 0x54:	EEPROM
- I2C device found at address 0x5C:	Misc.
- I2C device found at address 0x68:	MPU6050
- I2C device found at address 0x69:	ICM42670
- I2C device found at address 0x7E:	Misc.
- done
GroveVisionQ	0
MuQ	0
Set up the new board...
Unmute and set volume to 5/10
Using constants from I2C EEPROM
- Name the new robot as: Bittle45

If you do not see the startup information after opening the serial monitor, please short press the Reset button on the mainboard.

Next you will see the following prompt questions:

Reset the joints' calibration offsets? (Y/n): 
  • Send 'Y' to the question, which means resetting all servo corrections to zero.

  • Send "n" to skip this step.

If you want to keep the previous joint calibration data, please send 'n'.

- Calibrate the Inertial Measurement Unit (IMU)? (Y/n): 
  • Send 'Y' to the question, which means calibrating the IMU, i.e. the gyro/accelerometer sensor.

  • Send "n" to skip this step.

If you want to keep the previous IMU calibration data, please send 'n'.

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.

Run factory quality assurance program? (Y/n)        

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:

* Start *
Scanning I2C network...
- I2C device found at address 0x54  !
- I2C device found at address 0x68  !
- done
Set up the new board...
// 蓝牙连接时使用的设备名称
- Name the new robot as: BittleED    
Reset the joints' calibration offsets? (Y/n): 
Y
Buzzer volume: 5/10
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n): 
Y

Put the robot FLAT on the table and don't touch it during calibration.

Initializing MPU6050...
OK
If the program stucks, reinstall Arduino ESP32 boards version 2.0.12. Newer version may cause bugs!
- Testing MPU connections...attempt 0
- MPU6050 connection successful
- Initializing DMP...
MPU offsets: 2691	1893	1181	72	-57	0	
Calibrate MPU6050...
>....................>....................
MPU offsets:
//           X Accel  Y Accel  Z Accel   X Gyro   Y Gyro   Z Gyro
//OFFSETS     2759,    1871,    1173,      73,     -56,      -4
- Enabling DMP...
- DMP ready! Waiting for the first interrupt...
BLE:		Bittle45_BLE
Waiting for a BLE client connection to notify...
SSP:		Bittle45_SSP
The SSP device is started, now you can pair it with Bluetooth!
Setup ESP32 PWM servo driver...
Calibrated Zero Position
135	225	135	135	190	80	190	80	190	80	80	190	
Build skill list...88
Run factory quality assurance program? (Y/n)
(Auto skip in 5 seconds)
5...4...3...2...1...n
TaskQ
rest
11
Init voice
Number of customized voice commands on the main board: 
10
Turn on the audio response
Show Petoi Logo color
S,	A,	T,	L,	D,	I,	B,	U,	G,	C,	Q,	
0,	1,	0,	0,	0,	0,	0,	0,	0,	0,	0,	
Ready!
g
rest
d
XAaXAc
Switch English

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.

Note: When the mainboard is powered on, the music melodies played in the regular startup mode and the initialization startup mode are completely different. This is convenient for users (no need to open the serial monitor) and can also identify the startup mode.

If you need to clear the calibration parameters of the servo and recalibrate the joint servo, or recalibrate the IMU, you can send the serial command "!" in the serial monitor, and the program will re-enter the initialization startup mode.

2.9 Swith working 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 send the following serial commands:

Serial command
Function

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)

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.

2.10 Power on

  • 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.

3. Configuration with App

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.

2.6 via USB type-C data cable

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 .

BiBoard V0 Guide
BiBoard V1 Guide
Chapter 3.2.1
Add hardware partition configuration option in Arduino IDE
https://github.com/PetoiCamp/OpenCatEsp32
MU Vision Sensor library
the driver
https://www.wch-ic.com/downloads/CH343SER_EXE.html
https://www.wch-ic.com/downloads/CH34XSER_MAC_ZIP.html
mainboard (BiBoard) version
EXTENSIBLE MODULES
Chapter 5 🔌 Connect Wires
Chapter 6 📐 Calibration
mobile app
joint calibration
remote control
ChangeLog.md
Connect to BiBoard