Inertial Measurement UnitThe IMU is a small PCB that contains a gyroscope and accelerometer, each measuring a different part ofthe angle.With the angle measurement from the IMU, the Arduino can determine how fast and in whichdirection to turn the two motors. The easiest angle approximation (and Arduino coding) is done using a–90 degree to +90 degree scale, where 0 degrees is considered “level” (see Figure 11-2). If the anglemeasured from the IMU is 0 degrees, the motors stops; above 0 degrees and the motors goproportionally forward; and below 0 degrees and the motors go proportionally reverse. This behaviorkeeps the Seg-bot level and enables you to control its speed and direction by leaning front to back.
đang được dịch, vui lòng đợi..