Skip to content
Snippets Groups Projects
Commit 4daf9820 authored by Caughlin Bohn's avatar Caughlin Bohn
Browse files

Checksum fix to prevent multilooping

parent b2d545d3
Branches
No related tags found
No related merge requests found
......@@ -113,13 +113,20 @@ s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT))
s.listen(1)
#conn, addr = s.accept()
lastItem = 0
while 1:
conn, addr = s.accept()
data = conn.recv(1024)
conn.close()
tempData = data.split(" ")
iter = 0
while iter < int(tempData[2]):
if tempData[3] != lastItem:
print("I am lying about loops" , data)
for i in range(int(tempData[2])):
print(data,iter)
start = NodePath[tempData[0]]
end = NodePath[tempData[1]]
......@@ -134,12 +141,12 @@ while 1:
print("empty path")
try:
for a in path:
data = 128
for i in NetLights.get(a):
r,g,b = 255,0,0
strip.setPixelColor(i,Color(r,g,b))
strip.show()
time.sleep(0.001)
time.sleep(0.005)
for i in range(0,100):
strip.setPixelColor(i, Color(0,0,0))
......@@ -151,5 +158,6 @@ while 1:
print(str(e))
x=0
print("ERROR")
conn.close()
lastItem = tempData[3]
#conn.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment