Skip to content

Commit 602a5be

Browse files
authored
Update main.py
1 parent 69074d9 commit 602a5be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
### INITIALISATION
1212

13-
print("Ouverture de Xampp...")
14-
os.system(r"c: && cd C:\xampp && xampp_start") #On lance xampp
1513

1614
connection = mysql.connector.connect(host='localhost', database='', user='root', password='')
1715
curseur = connection.cursor()
@@ -47,6 +45,9 @@ def ajout_temperature_BDD(temperature):
4745
except shutil.Error: #Si le fichier a deja été déplacé
4846
pass
4947

48+
print("Ouverture de Xampp...")
49+
os.system(r"c: && cd C:\xampp && xampp_start") #On lance xampp
50+
5051
webbrowser.open("http://localhost/phpmyadmin/sql.php?db=temperatures&table=temperatures_glaciere&pos=0")
5152
webbrowser.open("http://localhost/suivi_temperature_glaciere.php") #On ouvre le site en local
5253

@@ -65,9 +66,9 @@ def publication(topic, message): #On publie un topic et un message
6566

6667
ARDUINO = "COM3" #On part du principe que la carte Arduino se trouve sur le port 3
6768
ser = serial.Serial(ARDUINO, timeout=1) #On lit le port de la carte Arduino
69+
ser.flushInput()
6870

6971
while True: #Boucle infinie
70-
ser.flushInput()
7172
serialValue = ser.readline().strip()
7273
if len(serialValue) == 5: #On filtre la valeur pour n'avoir que la température
7374
# if serialValue != valeur_precedente:

0 commit comments

Comments
 (0)