Hardware Reference
In-Depth Information
numberOfQuestions = 0
for line in qfile.readlines():
questions.append(line)
numberOfQuestions +=1
qfile.close()
random.shuffle(questions)
placeX = [490,490,355,625,490, 150, 800]
placeY = [ 20, 110, 305, 305, 510, 80 ,80]
aPos = [-1,-1,-1,-1]
single = [0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0]
background.fill(cBackground) # make background colour
font = pygame.font.Font(None, 28)
seq = [ 1 << (temp & 0x7) for temp in range (0,32)]
# initial sequence
timeInc = 0.3
stepInt = True # getting the step signal from inside the Pi
step = 0 # start point in sequence
nextTime = time.time()
answer = “answer”
answerPos = -1
def main():
ask =0
while True :
while pfio.read_input() != 0:
checkForEvent() # wait until switch is released
setupScreen(ask)
checkInput()
ask += 1
if ask >= numberOfQuestions :
ask = 0
random.shuffle(questions)
def checkInput():
buttonsInput = 0
while buttonsInput == 0:
buttonsInput = pfio.read_input()
checkForEvent()
if buttonsInput >= 0x10 :
first = “ player 2 “
second = “ player 1 “
continued
Search WWH ::




Custom Search