Page 6 - Computing Book 8
P. 6
Class 8
Do…Next loop ___________________________________________________________________________ 51
Mouse Events ___________________________________________________________________________ 52
Functions, Subroutines, and Modules: ________________________________________________________ 53
Creating User-Defined Functions: ___________________________________________________________ 53
Modules: _______________________________________________________________________________ 54
Creating a Good User Interface: _____________________________________________________________ 55
Bad User Interfaces: ______________________________________________________________________ 56
Program Debugging and Error Handling: _____________________________________________________ 57
Programming Robots and Single-Board Computers _____________________________________ 59
What is a Single Board Computer?___________________________________________________________ 59
Raspberry Pi ____________________________________________________________________________ 59
Exploring the Raspberry Pi _________________________________________________________________ 59
Here’s a Glance of What Each Component of a Raspberry Pi Does: _________________________________ 59
Accessories Needed for the Raspberry Pi: _____________________________________________________ 60
Raspberry Pi Architecture: _________________________________________________________________ 60
General Purpose Input Output (GPIO): ________________________________________________________ 60
Ports: __________________________________________________________________________________ 60
Raspbian OS ____________________________________________________________________________ 61
Python Basics: ___________________________________________________________________________ 61
Variables _______________________________________________________________________________ 62
Values: _________________________________________________________________________________ 62
LIST in Python: ___________________________________________________________________________ 62
Delete and Add List Elements: ______________________________________________________________ 63
Python Conditions and If Statements _________________________________________________________ 63
IF _____________________________________________________________________________________ 63
Elif for Multiple Conditions _________________________________________________________________ 63
Else ___________________________________________________________________________________ 64
Conditional Operators & Logical Operators: ___________________________________________________ 64
Python ‘For’ Loops _______________________________________________________________________ 64
Python Functions_________________________________________________________________________ 64
First Python Program with Raspberry Pi: ______________________________________________________ 65
Blinking LED Program: ____________________________________________________________________ 66
Button Controlled LED: ____________________________________________________________________ 66
Interfacing with SONAR Sensor: _____________________________________________________________ 67
The City School /Academics/Computing Curriculum/Class 8/2020-2021 Page 5 of 75

