Hardware Reference
In-Depth Information
y = 10
for bit in range(0,8):
# first draw the box -
# fill colour depends on sequence bit state
if ((value >> boxNum) & 1) != 1 :
pygame.draw.rect(screen,cLEDoff, ;
(x, y + 24*boxNum, 20,20), 0)
else :
pygame.draw.rect(screen,cLEDon, ;
(x, y + 24*boxNum, 20,20), 0)
#now draw the outline of the box
pygame.draw.rect(screen,cOutline, ;
(x, y + 24*boxNum, 20,20), 2)
boxNum +=1
def mouseGet() : # see where we have
# clicked and take the appropriate action
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) :
continued
Search WWH ::




Custom Search