This commit is contained in:
Neptune-1
2018-12-06 23:13:42 +03:00
parent 716a955276
commit 2bd0b0690a
2 changed files with 10 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ sock.send(bytes('left','utf-8'))
command = ''
def receive():
global command
try:
while True:
data = str(sock.recv(1024))
@@ -21,12 +22,6 @@ def receive():
data = str(sock.recv(1024))
if b'stop' in data:
xm.write(data[:data.index(b'stop')])
t_0 = Thread(target=animation)
t_0.daemon = True
t_0.start()
time.sleep(2)
break
else:
xm.write(data)
@@ -40,7 +35,7 @@ def receive():
except Exception as e:
print(e)
except:
print('er')
sock.close()
@@ -49,13 +44,11 @@ def receive():
led.off()
sock.close()
def main():
pass
def
if __name__==__main__:
main()
t_0 = Thread(target=receive)
t_0.daemon = True
t_0.start()

View File

@@ -53,7 +53,9 @@ def read_animation_file():
'blue': blue,
'yaw': yaw
})
def frame()
global frames
return frames
if __name__ == '__main__':
read_animation_file()