-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatmo_ssh.py
More file actions
48 lines (37 loc) · 1.03 KB
/
atmo_ssh.py
File metadata and controls
48 lines (37 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import os
import atmo_dotstar
import pygame
from pygame.locals import *
import unity_server
exit = False
pygame.init()
window = pygame.display.set_mode((100, 100))
atmo_dotstar.strip.begin() # Initialize pins for output
atmo_dotstar.strip.setBrightness(atmo_dotstar.BRIGHTNESS)
atmo_dotstar.setBackground(atmo_dotstar.bgColor)
while True:
m = server.receive()
if m == 'shot1':
atmo_dotstar.gunShot(3)
elif m == 'gatling':
atmo_dotstar.gGunShot(3)
# elif message == 'shot2':
# atmo_dotstar.gunShot(2)
# elif message == 'shot3':
# atmo_dotstar.gunShot(3)
# elif message == 'shot4':
# atmo_dotstar.gunShot(4)
elif m == 'arrow':
atmo_dotstar.arrowShot()
elif m == 'beer':
atmo_dotstar.beerDrink(3)
# elif m == 'tnt_on':
# on = True
# while on:
# if a.read() == 'tnt_off':
# on = False
# else:
# atmo_dotstar.tntEffect()
elif m == 'exit':
server.close()
break