Professional Documents
Culture Documents
Fastly!
West Coast HTV SE
Eric Burns
burns@fastly.com
To prepare for the event, make sure you have the following ready and available:
Image courtesy of
WikiCommons.
Let’s update the code - and glare at Burns for bad script
You can download latest versions from https://github.com/ericburnsonline/Python-RPi-GPIOExamples)
This time the while loop is a “not button4pressed” (which starts as False)
TIMTOWTDI could be “button4notpressed” starting as True
Example pseudo code similar to “Moria” game from the 80’s:
main() {
while (! dead) {
play();
}
}
We have a for loop that goes through each item in the List of pins
We set a GPIO pin as either True (on) or False (off), the RPi turns the voltage on or off
accordingly
©2020 Fastly, Inc. | Confidential 33
Reaction game . . .