Samo Penic
2022-05-24 ff462a7ce664a8e224c32d1acbb82f9692c5327f
1
2
3
4
5
6
7
8
#!/usr/bin/python3
 
#use as: read_accelerometer > output_file.dat
import serial
with serial.Serial('/dev/ttyUSB0', 115200) as ser:
    while(True):
        line = ser.readline()
        print(line.decode('UTF-8'));