405 Documentation  9.0
lab02.py File Reference

Speed Game. More...

Classes

class  lab02.RxnGame
 Reaction Game Class. More...
 

Functions

def lab02.gameLoop (game)
 Run game indefinitely. More...
 
def lab02.main ()
 Main. More...
 

Detailed Description

Speed Game.

This script incorperates an LED, button, and timer into a reflex game. One begun the player has a random amount of time between 2 and 3 seconds before the onboard green LED is illuminated. Once lit, the user has one second to press the blue button on the board. Their reation time is recored and reported. If they fail to press the button within the second their session expires and their stats are printed to the screen before the next session begins automatically. The game continues indefinitely unitl the user presses ^C to quit.

Author
Hunter Morse
Date
Jan 28, 2021

Function Documentation

◆ gameLoop()

def lab02.gameLoop (   game)

Run game indefinitely.

Game continues plays until ^C pressed

Parameters
gameis a RxnGame object

◆ main()

def lab02.main ( )

Main.

Funition auto-runs after boot. Initializes game object and begins gameLoop