Skip to content

Commit d26a648

Browse files
initial repo load
1 parent e20262f commit d26a648

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

README.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,22 @@ Or the following command to update an existing version:
7474
Usage Example
7575
=============
7676

77-
.. todo:: Add a quick, simple example. It and other examples should live in the
78-
examples folder and be included in docs/examples.rst.
77+
.. code-block:: python
78+
79+
import board
80+
import time
81+
from shadowwatcher import ShadowWatcher
82+
# Instantiate detector class and establish background level
83+
gesture = ShadowWatcher(pin=board.LIGHT, auto=True)
84+
while True:
85+
if gesture.detect():
86+
print(f"SHADOW DETECTED")
87+
while gesture.detect():
88+
# Wait until the shadow is gone
89+
time.sleep(1)
90+
# Rebaseline the background level
91+
gesture.refresh_background()
92+
print(f"background: {gesture.background:6.0f}")
7993
8094
Documentation
8195
=============

0 commit comments

Comments
 (0)