Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/buildhat/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ power supply. For best results, use the `official Raspberry Pi Build HAT power s
colordistancesensor.rst
distancesensor.rst
forcesensor.rst
light.rst
matrix.rst
motionsensor.rst
motor.rst
motorpair.rst
passivemotor.rst
tiltsensor.rst
hat.rst
light.rst
11 changes: 11 additions & 0 deletions docs/buildhat/motion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Example using motion sensor"""

from time import sleep

from buildhat import MotionSensor

motion = MotionSensor('A')

for _ in range(50):
print(motion.get_distance())
sleep(0.1)
19 changes: 19 additions & 0 deletions docs/buildhat/motionsensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Motion Sensor
=============

|location_link|

.. |location_link| raw:: html

<a href="https://www.bricklink.com/catalogItemInv.asp?S=45304-1" target="_blank">BrickLink item</a>

.. autoclass:: buildhat.MotionSensor
:members:
:inherited-members:

Example
-------

.. literalinclude:: motion.py


11 changes: 11 additions & 0 deletions docs/buildhat/tilt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Example using tilt sensor"""

from time import sleep

from buildhat import TiltSensor

tilt = TiltSensor('A')

for _ in range(50):
print(tilt.get_tilt())
sleep(0.1)
19 changes: 19 additions & 0 deletions docs/buildhat/tiltsensor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Tilt Sensor
===========

|location_link|

.. |location_link| raw:: html

<a href="https://www.bricklink.com/catalogItemInv.asp?S=45305-1" target="_blank">BrickLink item</a>

.. autoclass:: buildhat.TiltSensor
:members:
:inherited-members:

Example
-------

.. literalinclude:: tilt.py