This commit is contained in:
2022-09-15 16:17:37 +02:00
parent 40a6a58e72
commit f2806ccce1
4 changed files with 100 additions and 0 deletions

View 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
View 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
1 b'Applejack is best pony ! Received by Pauline Srifi ~\r\n' 2022-09-15 16:16:06.340607
2 b'h%l\xcc\x12.\x9d\x14\x13Pauline temp is 115\xc2\xb0.\r\n' 2022-09-15 16:16:09.275030
3 b'Pauline temp is 121\xc2\xb0.\r\n' 2022-09-15 16:16:14.333684
4 b'Pauline temp is -1\xc2\xb0.\r\n' 2022-09-15 16:16:19.390743
5 b'Pauline temp is -43\xc2\xb0.\r\n' 2022-09-15 16:16:24.449501
6 b'Pauline temp is -26\xc2\xb0.\r\n' 2022-09-15 16:16:29.507680
7 b'Pauline temp is -24\xc2\xb0.\r\n' 2022-09-15 16:16:34.566655
8 b'Pauline temp is 112\xc2\xb0.\r\n' 2022-09-15 16:16:39.624938
9 b'Pauline temp is -50\xc2\xb0.\r\n' 2022-09-15 16:16:44.681967
10 b'Pauline temp is -2\xc2\xb0.\r\n' 2022-09-15 16:16:49.740181