Skip to content

Commit b710a66

Browse files
committed
Change CRLF to LF endings
1 parent eba91ce commit b710a66

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

examples/lidar_test.py

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
from math import floor
2-
from adafruit_rplidar import RPLidar
3-
4-
# Setup the RPLidar
5-
PORT_NAME = "/dev/ttyUSB0"
6-
lidar = RPLidar(None, PORT_NAME, timeout=3)
7-
8-
# used to scale data to fit on the screen
9-
max_distance = 0
10-
11-
12-
def process_data(data):
13-
print(data)
14-
15-
16-
scan_data = [0] * 360
17-
18-
try:
19-
# print(lidar.get_info())
20-
for scan in lidar.iter_scans():
21-
for (_, angle, distance) in scan:
22-
scan_data[min([359, floor(angle)])] = distance
23-
process_data(scan_data)
24-
25-
except KeyboardInterrupt:
26-
print("Stopping.")
27-
lidar.stop()
28-
lidar.disconnect()
1+
from math import floor
2+
from adafruit_rplidar import RPLidar
3+
4+
# Setup the RPLidar
5+
PORT_NAME = "/dev/ttyUSB0"
6+
lidar = RPLidar(None, PORT_NAME, timeout=3)
7+
8+
# used to scale data to fit on the screen
9+
max_distance = 0
10+
11+
12+
def process_data(data):
13+
print(data)
14+
15+
16+
scan_data = [0] * 360
17+
18+
try:
19+
# print(lidar.get_info())
20+
for scan in lidar.iter_scans():
21+
for (_, angle, distance) in scan:
22+
scan_data[min([359, floor(angle)])] = distance
23+
process_data(scan_data)
24+
25+
except KeyboardInterrupt:
26+
print("Stopping.")
27+
lidar.stop()
28+
lidar.disconnect()

0 commit comments

Comments
 (0)