-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSemaforo.py
executable file
·50 lines (34 loc) · 1.07 KB
/
Semaforo.py
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
47
48
49
50
#-*-coding:utf-8
'''
PUG-PE Arduino Tools
Por Marcel Pinheiro Caraciolo - [email protected]
Victor Case - [email protected]
Gabriel Liber - [email protected]
Diego Liber - [email protected]
Semaforo PUG-PE
'''
import time,pygame
from arduino_handler import *
from pygame.locals import *
if __name__ == '__main__':
arduino = Arduino()
pygame.init()
windowsSurface = pygame.display.set_mode((640,480),0,32)
pygame.display.set_caption('Semaforo')
Vermelho = False
Verde = False
while True:
for event in pygame.event.get():
if event.type == KEYDOWN:
if event.key == K_v:
Verde = True
if event.key == K_f:
Vermelho = True
if Verde == True:
arduino.send_message(PASS)
Verde = False
Vermelho = False
if Vermelho == True:
arduino.send_message(FAIL)
Verde = False
Vermelho = False