Skip to content

Commit f26b539

Browse files
committed
updated example to include python serial setup
1 parent 1982948 commit f26b539

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

examples/bno08x_rvc_simpletest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
import time
55
import board
66
import busio
7-
from adafruit_bno08x_rvc import BNO08x_RVC
87

98
uart = busio.UART(board.TX, board.RX, baudrate=115200, receiver_buffer_size=2048)
9+
10+
# uncomment and comment out the above for use with Raspberry Pi
11+
# import serial
12+
# uart = serial.Serial("/dev/serial0", 115200)
13+
14+
# for a USB Serial cable:
15+
# import serial
16+
# uart = serial.Serial("/dev/ttyUSB0", baudrate=115200)
17+
18+
from adafruit_bno08x_rvc import BNO08x_RVC # pylint:disable=wrong-import-position
19+
1020
rvc = BNO08x_RVC(uart)
21+
1122
while True:
1223
yaw, pitch, roll, x_accel, y_accel, z_accel = rvc.heading
1324
print("Yaw: %2.2f Pitch: %2.2f Roll: %2.2f Degrees" % (yaw, pitch, roll))

0 commit comments

Comments
 (0)