You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
239 B
18 lines
239 B
5 years ago
|
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()
|