NyBoard Configuration for OpenCat 2.0

Setup Process

OpenCat software works on both Nybble and Bittle, controlled by NyBoard based on ATmega328P. More detailed documentation can be found at the NyBoard V1_0 or NyBoard V1_1.
Note: the version number is here

Dial the I2C switch (SW2) to Ar.

The I2C switch changes the master of I2C devices (gyro/accelerometer, servo driver, external EEPROM). On default “Ar”, NyBoard uses the onboard ATmega328P as the master chip; On “Pi”, NyBoard uses external chips connected through the I2C ports (SDA, SCL) as the master chip.
Sometimes if you cannot go through the bootup stage, maybe you have accidentally dialed the switch to "Pi".

Downloads and installations

You will need the newest Arduino IDE to set up the environment. Older versions tend to compile larger hex files that may exceed the memory limit.
To configure the board, please follow these steps:
  1. 1.
    Download the repo and unfold. Remove the -main (or any branch name) suffix of the folder.
  2. 2.
    Open the file OpenCat.ino, select your robot and board version. For example:
#define BITTLE //Petoi 9 DOF robot dog: 1x on head + 8x on leg
//#define NYBBLE //Petoi 11 DOF robot cat: 2x on head + 1x on tail + 8x on leg
//#define NyBoard_V0_1
//#define NyBoard_V0_2
#define NyBoard_V1_0
//#define NyBoard_V1_1
The symbol // inactivates the line of code and turns them into comments. Make sure you have only one line of the parallel options activated.
3. Comment out #define MAIN_SKETCH so that it will turn the code to the board configuration mode. Upload and follow the serial prompts to proceed.
// #define MAIN_SKETCH
If you activate #define AUTO_INIT, the program will automatically set up without prompts. It will not reset joint offsets but calibrate the IMU. It's just a convenient option for our production line.
4. Plug the USB uploader into your computer. Install the driver if no USB port is found under Arduino -> Tools -> Port.
5. Plug the USB uploader into the NyBoard.
6. Press the upload button.
7. Open the serial monitor. You can find the button either under Tools, or at the top-right corner of the IDE.
Set the serial monitor as No line ending and 115200 baud rate.
The serial prompts:
Reset joint offsets? (Y/n):
Input ‘Y’ and hit enter, if you want to reset all the joint offsets to 0.
The program will do the reset, then update the constants and instinctive skills in the static memory.
8. IMU (Inertial Measurement Unit) calibration.
The serial prompts:
Calibrate the IMU? (Y/n):
Input ‘Y’ and hit enter, if you have never calibrated the IMU or want to redo calibration.
Put the robot flat on the table and don't touch it. The robot will long beep six times to give you enough time. Then it will read hundreds of sensor data and save the offsets. It will beep when the calibration finishes.
When the serial monitor prints "Ready!", you can close the serial monitor to do the next step.
9. Uncomment #define MAIN_SKETCH to make it active. This time the code becomes the normal program for the major functionalities. Upload the code.
When the serial monitor prints "Ready!", the robot is ready to take your next instructions.
10. If you have never calibrated the joints’ offsets or reset the offsets in Step2, you need to calibrate them. If you boot up the robot with one side up, it will enter the calibration state automatically for you to install the legs. Otherwise, it will enter the normal rest state.
11. You can use the serial monitor to calibrate it directly. Or you may plug in the Bluetooth dongle, and use the Petoi app (on Android/iOS) for a more user-friendly interface. The mobile app is available on:
You can refer to the calibration section in the user manual (https://bittle.petoi.com/6-calibration) and Guide for the Petoi App (https://docs.petoi.com/app-guide).
11. You can use the infrared remote or other applications (such as the Petoi App, python, serial monitor ... etc.) to play with the robot (https://bittle.petoi.com/7-play-with-bittle).