python模块使用adxl345。
adxl345的Python项目详细描述
ADXL345
==
python模块使用ADXL345。与Python 2和Python 3兼容。
>基于[pimoroni/adxl345-python(https://github.com/pimoroni/adxl345-python](https://github.com/pimoroni/adxl345-python)的。
`` bash
`` bash
>pip install adxl345
`>
>
>基于[br/>
模块化并实例化ADXL345```'Br/>>BR/>‘Python’Br/>轴=ADXL345。GETX轴(<)BR/>< BR>>Br/>轴[[ X′]=& gt;- 0.1614 ] Br/>轴[[ y′]=>0.0691〉Br/>轴[[ z′]=>9.8064<BR/>′
BR/> -获得三轴加速度Python < BR/>从ADXL345导入ADXL345
BR/> ADXL345=ADXL345()< BR>地球引力(地球引力)的计算方法
``python
axes=adxl345.get_axes(true)
`;返回如下内容:
` axes['x']=>;-0.0014
` axes['y']=>;0.0001
` axes['z']=>;1.0012
```
``
`>
>
```
` ` `>
>
`=>>-使用另一个ic2地址
br/>br/>>默认情况下,此库使用“0x53”I2C地址。
若要使用其他地址,set it when creating an instance of ADXL345:
``` python
adxl345 = ADXL345(0x1D)
```
## Full example
``` python
from adxl345 import ADXL345
adxl345 = ADXL345()
axes = adxl345.get_axes(True)
# Returns something like:
# axes['x'] => -0.0014
# axes['y'] => 0.0001
轴['z']=>;1.0012
````
==
python模块使用ADXL345。与Python 2和Python 3兼容。
>基于[pimoroni/adxl345-python(https://github.com/pimoroni/adxl345-python](https://github.com/pimoroni/adxl345-python)的。
`` bash
`` bash
>pip install adxl345
`>
>
>基于[br/>
模块化并实例化ADXL345```'Br/>>BR/>‘Python’Br/>轴=ADXL345。GETX轴(<)BR/>< BR>>Br/>轴[[ X′]=& gt;- 0.1614 ] Br/>轴[[ y′]=>0.0691〉Br/>轴[[ z′]=>9.8064<BR/>′
BR/> -获得三轴加速度Python < BR/>从ADXL345导入ADXL345
BR/> ADXL345=ADXL345()< BR>地球引力(地球引力)的计算方法
``python
axes=adxl345.get_axes(true)
`;返回如下内容:
` axes['x']=>;-0.0014
` axes['y']=>;0.0001
` axes['z']=>;1.0012
```
``
`>
>
```
` ` `>
>
`=>>-使用另一个ic2地址
br/>br/>>默认情况下,此库使用“0x53”I2C地址。
若要使用其他地址,set it when creating an instance of ADXL345:
``` python
adxl345 = ADXL345(0x1D)
```
## Full example
``` python
from adxl345 import ADXL345
adxl345 = ADXL345()
axes = adxl345.get_axes(True)
# Returns something like:
# axes['x'] => -0.0014
# axes['y'] => 0.0001
轴['z']=>;1.0012
````