Files

52 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2020-07-09 10:04:54 +08:00
# BALA2 Quick Start {docsify-ignore-all}
2020-09-11 15:37:39 +08:00
?>M5Bala2 has been calibrated , if you need to recalibrate, follow the steps below.
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
1. Place BALA2 on a horizontal desktop and keep it turned off.
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
2. Press and hold the middle key (ButtonB) and the red button on the left at the same time, and let go immediately after the screen lights up. At this time, IMU data will be obtained. Please do not touch them during this time.
2020-07-09 10:04:54 +08:00
2020-09-11 15:55:24 +08:00
<div class="product_pic"><img src="assets/img/quick_start/bala2/bala_user1.webp"></div>
2020-09-11 15:37:39 +08:00
3. After the data acquisition is completed, it will automatically enter the calibration mode interface. Press the left/right(ButtonA/ButtonC) key to increase or decrease the correction value. When the value is adjusted to a satisfactory value, press the B key to save the parameter.
2020-07-09 10:04:54 +08:00
2020-09-11 15:55:24 +08:00
<div class="product_pic"><img src="assets/img/quick_start/bala2/bala_user2.webp"></div>
2020-09-11 15:37:39 +08:00
4. Restart, BALA2 will run the saved parameters.
2020-07-09 10:04:54 +08:00
2020-09-11 15:55:24 +08:00
<div class="product_pic"><img src="assets/img/quick_start/bala2/bala_user3.webp"></div>
2020-07-09 10:04:54 +08:00
## Development Environment
2020-09-11 15:37:39 +08:00
[Arduino IDE](#Arduino-IDE)
2020-07-09 10:04:54 +08:00
## Arduino IDE
2020-09-11 15:37:39 +08:00
1. [Mac]Refer to this tutorial to configure Arduino IDE(#/zh_CN/arduino/arduino_development.md)
[Windows]Refer to this tutorial to configure Arduino IDE(#/zh_CN/arduino/arduino_development.md)
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
2. [Download the Example program](https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Application/Bala2)
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
3. Open the example code in Arduino
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
4. Make sure that BALA2 has connected to PC, then click `Tools` -> `Port` for selecting the corresponding serial port on Arduino IDE..
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
5. click `Tools` -> `Board: ` to select `M5Stack-Core-ESP32`.
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
6. Compile and upload.
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
## Use of servo
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
**Bala::SetServoAngle(uint8_t pos, uint8_t angle)**
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
uint8_t pos servo number(1 - 8),Among them, No. 5 - 8 servos are inside the BALA2 base
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
uint8_t angle servo angle
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
**Bala::SetServoPulse(uint8_t pos, uint16_t width)**
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
uint8_t pos servo number(1 - 8)Among them, No. 5 - 8 servos are inside the BALA2 base
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
uint16_t width pulse width
2020-07-09 10:04:54 +08:00
2020-09-11 15:37:39 +08:00
**For the use of M5Stack, please refer to [M5Stack GRAY](https://docs.m5stack.com/#/zh_CN/core/gray)**