Artimus 7 hónapja
szülő
commit
0dd9270794
4 módosított fájl, 21 hozzáadás és 5 törlés
  1. 21 4
      GUI.py
  2. 0 0
      pyBLE.py
  3. 0 0
      scores.txt
  4. 0 1
      sdfghfds

+ 21 - 4
GUI.py

@@ -1,7 +1,6 @@
 import customtkinter as ctk
 import json
 from PIL import Image, ImageTk
-
 import asyncio
 from bleak import BleakScanner
 from bleak import BleakClient
@@ -24,7 +23,24 @@ async def connect():
             print("could not find device")
     return target_address
 
-currentScore = 30
+#function that will recive the ESP32 data 
+def getCurrentScore():
+    print(30)
+    #than do math to figure out power level
+
+
+currentScore = getCurrentScore()
+highestScore = 100
+highScoreName = ""
+
+
+if currentScore > highestScore :
+    highestScore = currentScore
+    f = open("scores.txt", "rw")
+    f.write(highestScore + highScoreName)
+    scores.append(highestScore)
+    names.append(highScoreName)
+
 
 async def main():
     await connect()
@@ -39,8 +55,9 @@ canvas = ctk.CTkCanvas(app, width=250, height=250,highlightthickness=0,)
 canvas.config(background="white")
 canvas.place(x=0,y=0)
 
-names = ["one","two","three","four","five"]
-scores = [1,2,3,4,5]
+
+names = []
+scores = []
 
 def placeLeaderboard():
     canvas.create_rectangle(0, 0, 500, 500, fill="grey20", width=2) #grey14 to match background

+ 0 - 0
pyBLE.py


+ 0 - 0
scores.txt


+ 0 - 1
sdfghfds

@@ -1 +0,0 @@
-