M5Bala2 is calibrated at the factory. Follow the steps below if you need to recalibrate.
Place BALA2 on a level tabletop and ensure it is powered off.
Press and hold the middle button (ButtonB) and the left red button simultaneously. Release them as soon as the screen lights up. IMU data will be acquired during this process. Do not touch during this period.
[Mac Users] Refer to this tutorial to configure Arduino IDE [Windows Users] Refer to this tutorial to configure Arduino IDE
Open the example program in Arduino.
Connect BALA2 to the computer. Click on Tools
-> Port
to select the serial port used by the device.
Select the M5Stack-Core-ESP32
board in the Board
option.
Compile and upload the code.
Bala::SetServoAngle(uint8_t pos, uint8_t angle)
uint8_t pos: Servo number (1 - 8), where servos 5 - 8 are inside the BALA base.
uint8_t angle: Servo angle.
Bala::SetServoPulse(uint8_t pos, uint16_t width)
uint8_t pos: Servo number (1 - 8), where servos 5 - 8 are inside the BALA base.
uint16_t width: Pulse width.
For M5Stack usage, please refer to M5Stack GRAY