Python driver test
Test under windows
Take win7, a9, python2.7 as examples, test hif_a9.py
and hif_a9_ui.py
Plug in the USB device of the IMU, and check whether the computer can recognize the
Silicon Labs CP210x USB to UART Bridge (COM*)
* refers to any number. If there are multipleSilicon Labs CP210x USB to UART Bridge (COM*)
, please unplug the USB of the IMU again, and note the number of COM ports that the IMU recognizes by the computer.Enter the script directory and modify COM3 in the corresponding python script (the default COM3 used by the script) is the number recognized by your computer.
win+R opens a window titled run, enter cmd in the input box, and the command character interface that appears after pressing Enter (you can see an error after running through this character interface at the beginning, which is convenient for installation according to the error prompt missing dependencies or why the troubleshooting didn't run successfully). Use the
cd
command to go to the directory where the script is located, and then use thepython
command to run the script file. The following picture is a screenshot of the hfi_a9.py driver after the successful operation. After the successful operation, the following information will be continuously printed under normal circumstances.Similarly, the screenshot of hfi_a9_ui.py after running successfully. The window titled handsfree imu, the data in it will be printed out.
Test under linux
Take ubuntu16.04, a9, python2.7 as examples, test hif_a9.py
and hif_a9_ui.py
Do not insert the USB of the IMU first, enter
ls /dev/ttyUSB*
in the terminal to check, then insert the USB into the computer, and then enterls /dev/ttyUSB*
in the terminal to check, the extra The ttyUSB device is the serial port of the IMU.Enter the script directory and modify /dev/ttyUSB0 in the corresponding python script (the script uses /dev/ttyUSB0 by default) for the number recognized by your computer
You can use the
cd
command to go to the directory where the script is located, or you can open a terminal in the directory where the script is located, and then use thepython
command to run the script. The following figure is a screenshot after the hfi_a9.py driver runs successfully.Similarly, the screenshot of hfi_a9_ui.py after running successfully. The window titled handsfree imu, the data in it will be printed out.