如果主板使用电池供电,请长按电池上的按钮 >=3 秒关闭主板电源,这样主板仅通过 USB 数据线供电,并且只有蓝色 LED 亮起。
2.7 编译并上传程序
在OpenCatEsp32.ino文件中,根据您所使用的设备类型,修改设备类型宏定义。
// #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
Nybble Q 机器人没有配带机械臂(Bittle R),请注释此行代码。:
// #define ROBOT_ARM // for attaching head clip arm
您可以在源代码文件(OpenCatEsp32/src/OpenCat.h)中查看当前上传程序代码的版本日期:
#define DATE "250218" // YYMMDD
您可以在串口监视器中,发送串口命令 “?” (英文字符) 查看机器人主板固件的版本日期:
在主板上电启动时,打开串口监视器,您将看到相关的启动信息:
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
如果您打开串口监视器后,没有看到相关启动信息,请短按一下主板上的复位(Reset)按钮。
接下来您将看到以下提示问题:
Reset the joints' calibration offsets? (Y/n): // 是否清除所有舵机的校准参数?
发送英文字符“Y”,把所有舵机的修正值归零。
发送英文字符“n”, 跳过此步骤。
如您需保留之前的关节校准数据,请发送英文字符“‘n’。
- Calibrate the Inertial Measurement Unit (IMU)? (Y/n): // 是否校准IMU(MPU6050)?
Run factory quality assurance program? (Y/n) // 运行工厂质检程序
发送英文字符“n”, 跳过此步骤。或者您什么也不需要做,程序将在 5 秒后自动跳过此步骤。
与提示问题相关的串口打印信息详情如下:
* 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