Page 310 - 3-2
P. 310
else: output_b4(x,y)
elif(num is 5): # b5
screen.blit(b5, (0, 0))
pygame.display.flip()
if (860 < x < 1010) and (15 < y < 65): speak() # 음성인식 버튼
elif (860 < x < 960) and (175 < y < 550): search(x, y) # 수동 버튼
else: output_b5(x,y)
elif(num is 6): # b6
screen.blit(b6, (0, 0))
pygame.display.flip()
if (860 < x < 1010) and (15 < y < 65): speak() # 음성인식 버튼
elif (860 < x < 960) and (175 < y < 550): search(x, y) # 수동 버튼
else: output_b6(x,y)
def train(info):
global x,y
global ser
global i
global subprocess
while True:
for event in pygame.event.get():
# 창닫기 버튼을 눌렀을 때
if event.type == QUIT:
pygame.quit()
sys.exit()
# 마우스 이벤트 처리
if event.type == MOUSEBUTTONDOWN and event.button == LEFT:
x, y = pygame.mouse.get_pos()
if(0 < x < 150) and (0 < y < 80): first() # 돌아가기
if(info is 0):
screen.blit(a0, (0, 0))
pygame.display.flip()
serial_info(info) # one_serial_voice.py
elif(info is 1):
screen.blit(a1, (0, 0))
pygame.display.flip()
#subprocess.call('sudo scrot /home/pi/pygame_test/a100.png', shell=True)
serial_info(info)
elif(info is 2):
screen.blit(a2, (0, 0))
pygame.display.flip()
#subprocess.call('sudo scrot /home/pi/pygame_test/a100.png', shell=True)
serial_info(info)
- 310 -