Skip to content

Commit 9c45656

Browse files
committed
feat: runtime examples read_tof
1 parent a7b258a commit 9c45656

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/arduino-runtime/read_tof.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from time import sleep_ms
2+
3+
from arduino import start
4+
from arduino_alvik import ArduinoAlvik
5+
6+
7+
alvik = ArduinoAlvik()
8+
9+
10+
def setup():
11+
alvik.begin()
12+
13+
14+
def loop():
15+
L, CL, C, CR, R = alvik.get_distance()
16+
T = alvik.get_distance_top()
17+
B = alvik.get_distance_bottom()
18+
print(f'T: {T} | B: {B} | L: {L} | CL: {CL} | C: {C} | CR: {CR} | R: {R}')
19+
sleep_ms(100)
20+
21+
22+
start(setup, loop)

0 commit comments

Comments
 (0)