Hardware Reference
In-Depth Information
global timeInc, stepInt
x,y = pygame.mouse.get_pos()
if y in range(10, 202) and x in range(10, 778 ) :
bit = (y -10) / 24
byte = (x- 10) / 24
seq[byte] ^= 1 << bit
drawCol(byte,seq[byte])
pygame.display.update()
elif y in range(216,248) :
if x in range(10,58) : # the clear control
for a in range(0,32):
seq[a] = 0
drawCol(a,seq[a])
pygame.display.update()
if x in range(86,148) : # the invert control
for a in range(0,32):
seq[a] ^= 0xff
drawCol(a,seq[a])
pygame.display.update()
if x in range(168,236) : # the faster control
timeInc -= 0.05
if timeInc <= 0 :
timeInc = 0.05
if x in range(250,324) : # the slower control
timeInc += 0.05
if x in range(350,482) :
# the step source control
stepInt = not stepInt
if stepInt :
drawControl(350,132,
“Auto Step”)
else:
drawControl(350,132,
“External Step”)
pygame.display.update()
else:
#print “mouse “,x,y
def terminate(): # close down the program
print (“Closing down please wait”)
pfio.deinit() # close the pfio
pygame.quit()
sys.exit()
continued
Search WWH ::




Custom Search