File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,27 @@ This is easily achieved by downloading
29
29
Usage Example
30
30
=============
31
31
32
- .. todo :: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
32
+ .. code-block :: python
33
+
34
+ import time
35
+ import board
36
+ import busio
37
+ import adafruit_lidarlite
38
+
39
+ # Create library object using our Bus I2C port
40
+ i2c = busio.I2C(board.SCL , board.SDA )
41
+
42
+ # Default configuration, with only i2c wires
43
+ sensor = adafruit_lidarlite.LIDARLite(i2c)
44
+
45
+ while True :
46
+ try :
47
+ # We print tuples so you can plot with Mu Plotter
48
+ print ((sensor.distance,))
49
+ except RuntimeError as e:
50
+ # If we get a reading error, just print it and keep truckin'
51
+ print (e)
52
+ time.sleep(0.01 ) # you can remove this for ultra-fast measurements!
33
53
34
54
Contributing
35
55
============
You can’t perform that action at this time.
0 commit comments