tp1
This commit is contained in:
24
tp1/python/Lecture_portcom.py
Normal file
24
tp1/python/Lecture_portcom.py
Normal file
@ -0,0 +1,24 @@
|
||||
import serial as s
|
||||
import datetime
|
||||
|
||||
ser=s.Serial()
|
||||
ser.baudrate = 9600
|
||||
ser.port = "COM5"
|
||||
ser.timeout=10
|
||||
|
||||
ser.open()
|
||||
f=open('datas.csv','w')
|
||||
|
||||
for uwu in range(0,10) :
|
||||
x = ser.readline()
|
||||
t = datetime.datetime.now()
|
||||
|
||||
f.write(str(x))
|
||||
f.write("; ")
|
||||
f.write(str(t))
|
||||
f.write("\n")
|
||||
print("Écriture de la ligne " + str(uwu+1))
|
||||
|
||||
print("écriture finie")
|
||||
f.close()
|
||||
ser.close()
|
10
tp1/python/datas.csv
Normal file
10
tp1/python/datas.csv
Normal file
@ -0,0 +1,10 @@
|
||||
b'Applejack is best pony ! Received by Pauline Srifi ~\r\n'; 2022-09-15 16:16:06.340607
|
||||
b'h%l\xcc\x12.\x9d\x14\x13Pauline temp is 115\xc2\xb0.\r\n'; 2022-09-15 16:16:09.275030
|
||||
b'Pauline temp is 121\xc2\xb0.\r\n'; 2022-09-15 16:16:14.333684
|
||||
b'Pauline temp is -1\xc2\xb0.\r\n'; 2022-09-15 16:16:19.390743
|
||||
b'Pauline temp is -43\xc2\xb0.\r\n'; 2022-09-15 16:16:24.449501
|
||||
b'Pauline temp is -26\xc2\xb0.\r\n'; 2022-09-15 16:16:29.507680
|
||||
b'Pauline temp is -24\xc2\xb0.\r\n'; 2022-09-15 16:16:34.566655
|
||||
b'Pauline temp is 112\xc2\xb0.\r\n'; 2022-09-15 16:16:39.624938
|
||||
b'Pauline temp is -50\xc2\xb0.\r\n'; 2022-09-15 16:16:44.681967
|
||||
b'Pauline temp is -2\xc2\xb0.\r\n'; 2022-09-15 16:16:49.740181
|
|
Reference in New Issue
Block a user