Skip to main content
ADXL345
=======

Python module to use ADXL345. Compatible with Python 2 and Python 3.

Based on [pimoroni/adxl345-python](https://github.com/pimoroni/adxl345-python).


## Install

Install it as a dependency using pip:

``` bash
pip install adxl345
```


## Usage

- Import module and instantiate an ADXL345

``` python
from adxl345 import ADXL345


adxl345 = ADXL345()
```

- Get 3-axis accelerations in m.s-²

``` python
axes = adxl345.get_axes()

# Returns something like:
# axes['x'] => -0.1614
# axes['y'] => 0.0691
# axes['z'] => 9.8064
```

- Get 3-axis accelerations in g (Earth gravity)

``` python
axes = adxl345.get_axes(True)

# Returns something like:
# axes['x'] => -0.0014
# axes['y'] => 0.0001
# axes['z'] => 1.0012
```

- Use another IC2 address

By default, this library uses the `0x53` I2C address.

To use another address, 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
# axes['z'] => 1.0012
```


## License

This project is under [MIT](LICENSE) license.

Metadata

Release files for adxl345 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adxl345 1.0.4
File Size Uploaded
adxl345-1.0.4.tar.gz 3.1 kB Details

Release files / adxl345-1.0.4.tar.gz

Download URL adxl345-1.0.4.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
108b95c2dd3787476b2ae1ed88f695693cb8b48c04cd9487aa1f6a2f5a58904f
BLAKE2b-256 checksum
How to use checksums
af1f4c8d34cf3a4bbce084aa574a005ce2b992f7a7269901bfba851b7b2a58d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page