Skip to content

Commit 26016f7

Browse files
committed
fix: suppression du try qui ne sert a rien
1 parent 9f4f5da commit 26016f7

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

scripts/masterI2C.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#masteri2c est la pour debug la communication entre l'arduino et la pi.
2+
13
import smbus #type: ignore #ignore the module could not be resolved error because it is a linux only module
24
import time
35
import numpy as np
@@ -31,18 +33,13 @@ def read_data(length):
3133
raise ValueError("Not enough data received from I2C bus")
3234

3335
if __name__ == "__main__":
34-
try:
35-
# Send data to the slave
36-
while(True):
37-
vitesse= float(input("vitesse en millimetre par seconde:"))
38-
rotation= float(input("rotation en degré:"))
39-
write_data(vitesse,rotation)
40-
time.sleep(0.1) # Wait for the slave to process the data
41-
received = read_data(8) # Adjust length as needed
42-
print("Received from slave:", received)
36+
while(True):
37+
vitesse= float(input("vitesse en millimetre par seconde:"))
38+
rotation= float(input("rotation en degré:"))
39+
write_data(vitesse,rotation)
40+
time.sleep(0.1) # Wait for the slave to process the data
41+
received = read_data(8) # Adjust length as needed
42+
print("Received from slave:", received)
4343

4444
# Request data from the slave
45-
46-
47-
except Exception as e:
48-
print("Error:", e)
45+

0 commit comments

Comments
 (0)