arismileti
5 years ago
1 changed files with 17 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||||
|
import serial |
||||
|
|
||||
|
from time import sleep |
||||
|
|
||||
|
ser = serial.Serial('/dev/ttyACM0', 38400) |
||||
|
sleep(1) |
||||
|
|
||||
|
file = open("dataset", "a") |
||||
|
file.write("[") |
||||
|
|
||||
|
for i in range(1000): |
||||
|
s = ser.readline() |
||||
|
print(s) |
||||
|
file.write(str(s)) |
||||
|
|
||||
|
file.write("]") |
||||
|
file.close() |
Loading…
Reference in new issue