# BiBoard V0

## Hardware setup

It is built into the [**BiBoard V0's extension hat**](https://docs.petoi.com/biboard/biboard-extension-hat#peripherals) as follows:

<figure><img src="https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/lvE1PhvFKwtVIuhNEwCs/image.png" alt=""><figcaption></figcaption></figure>

## Software setup

### 1. Upload Firmware

There are two methods to upload the firmware for the robot.

* **use the Petoi Desktop App**
* **use the Arduino IDE**

#### **Petoi Desktop App**

You can use the [Firmware Uploader](https://docs.petoi.com/desktop-app/firmware-uploader#select-the-correct-options-to-upload-the-latest-firmware) within the Petoi Desktop App.

Please select the correct ***Product*** type, ***Board version***, and ***Serial port***. The mode should be **Standard**, so press the **Upgrade the Firmware** button.&#x20;

For example, Bittle +X, BiBoard\_V0\_2, COM3 as follows:

<figure><img src="https://4130507397-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXLpFdG7mubqEHWylLK3w%2Fuploads%2FVbNhiP0nAtwMGRip8fKa%2Fimage.png?alt=media&#x26;token=c4ae52e2-f03d-4acc-b863-46864307207f" alt=""><figcaption></figcaption></figure>

#### **Arduino IDE**

You can use [Arduino IDE](https://www.arduino.cc/en/software) to [upload the sketch](https://docs.petoi.com/arduino-ide/upload-sketch-for-biboard#id-2.-set-up-biboard)(***OpenCatEsp32.ino***).&#x20;

Modify the product type macro definition in **OpenCatEsp32.ino** according to the product type you used.

```cpp
#define BITTLE    //Petoi 9 DOF robot dog, also for Bittle X
//#define NYBBLE  //Petoi 11 DOF robot cat, also for Nybble Q
//#define CUB
```

Modify the mainboard model macro definition in OpenCatEsp3&#x32;**.ino** according to the mainboard (BiBoard) version.

```cpp
// #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**) has the robotic arm, you should also activate the macro definition as follows:

```cpp
#define ROBOT_ARM                 // for attaching the head clip arm
```

Otherwise, please comment out this line of 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.

<figure><img src="https://content.gitbook.com/content/XLpFdG7mubqEHWylLK3w/blobs/zH1ef9g8JLDbQgipRdWG/image.png" alt=""><figcaption></figcaption></figure>

### 2. Switch mode

After uploading, the program defaults to Voice mode. If it is in another mode and you want to switch to Voice mode, please open the Serial Monitor and send the **`XA`** command.

## The test sketch

The test sketch is in the OpenCatEsp32 repository on GitHub (specific path: OpenCatEsp32/ModuleTests/testVoiceCommander). You can visit our GitHub repository <https://github.com/PetoiCamp/OpenCatEsp32> to download the complete code, as shown in the following picture:

<figure><img src="https://4130507397-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXLpFdG7mubqEHWylLK3w%2Fuploads%2FfPQKNm5CiJjfuc77KRhl%2Fimage.png?alt=media&#x26;token=6872eaba-c24a-4073-acc6-dac4db805f61" alt=""><figcaption></figcaption></figure>
