Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @reboot sudo python /home/pi/quiz/quiz.py &
- #example of a question
- def question2():
- print("Question2")
- while True:
- if GPIO.input(quiz_button1) == False:
- answer_correct(2)
- play_sound(fact_sound_2)
- break
- elif GPIO.input(quiz_button2) == False:
- answer_wrong(led_wrong)
- elif GPIO.input(quiz_button3) == False:
- answer_wrong(led_wrong)
- elif GPIO.input(quiz_button4) == False:
- answer_wrong(led_wrong)
- turn_led_on(ind_led2)
- def main():
- turn_all_leds_off()
- try:
- while True:
- # starts quiz
- find_null()
- print("Start of quiz")
- question1()
- question2()
- question3()
- question4()
- finally:
- GPIO.cleanup()
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement