File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff 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=============
You can’t perform that action at this time.
0 commit comments