Hardware Reference
In-Depth Information
moved = True
portP = (port & 0x30) >> 4
lastPortP = (lastPort &0x30) >> 4
if port &0x8 :
blank_screen()
lastPort = port
def blank_screen():
screen.fill(background) # blank screen
segment.fill(background)
pygame.display.update()
def terminate():
print “Closing down please wait”
pfio.deinit()
pygame.quit()
sys.exit()
def checkForQuit():
global col, picture, last_reading, fileName
event = pygame.event.poll()
if event.type == pygame.QUIT :
terminate()
elif event.type == pygame.KEYDOWN :
# get a key and do something
if event.key == pygame.K_ESCAPE :
terminate()
if event.key == K_SPACE or event.key == K_DELETE:
blank_screen()
if event.key == K_r : # draw in red
col = (255, 0, 0)
if event.key == K_g : # draw in green
col = (0, 255, 0)
if event.key == K_b : # draw in blue
col = (0, 0, 255)
if event.key == K_y : # draw in yellow
col = (255, 255, 0)
if event.key == K_m : # draw in magenta
col = (255, 0, 255)
if event.key == K_p : # draw in peacock blue
col = (0, 255, 255)
if event.key == K_w : # draw in white
col = (255, 255, 255)
continued
Search WWH ::




Custom Search