Skip to content

Commit

Permalink
added example
Browse files Browse the repository at this point in the history
  • Loading branch information
r0f1 committed Dec 14, 2024
1 parent 2dc7770 commit 78ac7f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
## Making a new release

* (On Raspberry Pi) Run `pytest`.
* Go to pyproject.toml and increase the version number
* Go to docs/source/conf.py and increase the version number
* Merge into main
* Merge into release. This will automaticall update the docs.
* On Github: Make a release. This will automatically publish it to PyPI
* Go to pyproject.toml and increase the version number.
* Go to docs/source/conf.py and increase the version number.
* Merge into main.
* Merge into release. This will automatically update the docs.
* On Github: Make a release. This will automatically publish it to PyPI.
8 changes: 8 additions & 0 deletions src/sts1_sensors/edu/ADXL345.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ def __init__(self, range=2, datarate=50, x_offset=0, y_offset=0, z_offset=0, add
:param int z_offset: z-axis offset, defaults to 0.
:param hexadecimal address: Physical address of the sensor on the board (see `i2cdetect` command). Allowed values: `[0x1D, 0x3A, 0x3B, 0x53]`. If None, the environment variable `STS1_SENSOR_ADDRESS_AVXL345` will be used. If environment variable is not found, 0x53 will be used.
:param SMBus bus: A SMBus object. If None, this class will generate its own, defaults to None.
Example:
.. code-block:: python
accel = ADXL345(range=2, datarate=50)
x, y, z = accel.get_g()
print(f"{x=:.2f} g, {y=:.2f} g, {z=:.2f} g")
"""
super().__init__(possible_addresses=[0x1D, 0x3A, 0x3B, 0x53], bus=bus)

Expand Down

0 comments on commit 78ac7f1

Please sign in to comment.