You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -72,20 +72,20 @@ You'll need to dedicate two pins to communicating with the HC-SR04. The sensor c
72
72
manner, so it doesn't matter which pins you choose, as long as they're digital IO pins (pins that start with "``D``"
73
73
are digital).
74
74
75
-
There are two ways of instantiating a :class:`~hcsr04.HCSR04` object: with or without using a context manager.
75
+
There are two ways of instantiating a `HCSR04` object: with or without using a context manager.
76
76
77
77
.. note::
78
78
79
79
It is technically possible to communicate with the HC-SR04 using only one wire since the trigger and echo signals
80
80
aren't ever active at the same time. Once I have a chance to determine a safe way to do this, I plan to add this as
81
81
a feature to the library.
82
82
83
-
.. seealso::
83
+
See Also:
84
84
85
85
`Adafruit's guide on Lifetime and ContextManagers <https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html#lifetime-and-contextmanagers>`_
86
86
Gives more info on using context managers with CircuitPython drivers.
A list of pins available on your device. To view this list, first `get a REPL
90
90
<http://circuitpython.readthedocs.io/en/latest/docs/pyboard/tutorial/repl.html>`_ (the guide linked was written
91
91
for the pyboard, but it still works), then input the following:
@@ -98,7 +98,7 @@ There are two ways of instantiating a :class:`~hcsr04.HCSR04` object: with or wi
98
98
Without a Context Manager
99
99
-------------------------
100
100
101
-
In the example below, we create the :class:`~hcsr04.HCSR04` object directly, get the distance every 2 seconds, then
101
+
In the example below, we create the `HCSR04` object directly, get the distance every 2 seconds, then
102
102
de-initialize the device.
103
103
104
104
::
@@ -117,7 +117,7 @@ de-initialize the device.
117
117
With a Context Manager
118
118
----------------------
119
119
120
-
In the example below, we use a context manager (the :any:`with <with>` statement) to create the :class:`~hcsr04.HCSR04`
120
+
In the example below, we use a context manager (the `with <https://docs.python.org/3.4/reference/compound_stmts.html#with>`_ statement) to create the `HCSR04`
121
121
instance, again get the distance every 2 seconds, but then the context manager handles de-initializing the device for
0 commit comments