Excited About Coding! - An Introduction To Coding Using Scratch 2 Software On The Raspberry Pi 4 Computer
Grant Williams
Copyright 2020 Grant Williams
All rights reserved.
No part of this book may be reproduced, or stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without express written permission of the publisher.
This book is dedicated to my brother Mark Williams, who showed me by example that it is possible for one person to have a big impact on the education of young people around the world. Mark was a prolific composer and arranger of music for student band and orchestra, and co-authored the popular music education method book series Accent on Achievement and Accent on Performance (Alfred Publishing).
Contents
Chapter 1: The Raspberry Pi Computer & Scratch Software
Welcome to the exciting world of computer coding!
In our modern world, computers are everywhere. They are contained in an ever-increasing number of common objects in our lives, including such things as phones, cars, and airplanes. Learning to write computer code is fun and it gives you an understanding of how these amazing machines work. This book is designed to get you coding quickly, with lots of descriptive pictures included so that you won't get stuck along the way. And while you are learning how to write computer code (known as coding, computer programming, or programming), you will be creating computer games that are fun to play! This is an excellent first book on computers for kids (ages 9 and up), and is also a great book for a person of any age who wants to get started learning about computers and coding. This book makes no assumptions about the readers current knowledge of computers, and covers all of the basic information that you will need. Children of ages 9-11 may need some assistance from an adult or older child in reading this book and doing the coding projects. However the coding projects have detailed diagrams which guide a student with less advanced reading abilities through all of the coding steps. For teachers and parents, this book provides easy-to-follow instructions on how to set up a low cost and child-friendly computer lab, and provides a foundation for developing teaching materials, with the option of using this book as the students textbook.
To write code, you need both hardware and software.
The term hardware refers to the physical computer (made of plastic, computer chips, memory cards, electronic circuits, and metal connectors) that you can hold in your hand. The term software refers to the instructions (also called computer code or programs) that come built-in on your computer (such as the operating system and pre-installed applications), as well as code that you write yourself to do such things as create a game or control a robot, and optionally any code that you obtain from another person or company that you install on your computer. In its simplest form, all software consists of bits of information that are electrically or magnetically set as zeroes and ones on computer hardware. The hardware that we will be using is the Raspberry Pi computer, which was originally developed in England at the University of Cambridge's Computer Laboratory. As a shortcut, I will refer to the Raspberry Pi computer as the Pi computer or simply the Pi. The Pi was designed to be a small, cheap computer that kids could use to begin learning about computers at an early age. If you want a low cost, easy to set up, and child-friendly computer for learning computer coding, the Pi is a fantastic choice. The Pi has become incredibly popular, with world-wide sales totaling over 25 million sold.
The software that we will be using is Scratch, which is a computer program (also referred to as an application) that was developed in the United States at Massachusetts Institute of Technology (MIT). Scratch was developed as a tool for kids to use to create their own computer programs. Scratch is used by millions of people around the world, and is considered the standard for introductory coding classes for children. Scratch comes preinstalled on the Micro SD memory card that is included in Pi computer kits.
Create your own computer coding lab.
Pi computers can be purchased at several online stores, such as Amazon.com and other sellers listed under the Products link at the Raspberry Pi Foundation website (www.raspberrypi.org). I recommend purchasing a kit that contains all of the components that you will need including the Pi computer circuit board, Micro SD memory card, power cord, HDMI cable, heat sinks, and plastic computer case. You can purchase the individual components separately, but the kits can be a simple (and often cheaper) way to get all the required parts. (NOTE: Plastic computer cases come in different colors, but I personally like a clear plastic case, since it allows you to see the Pi computer circuit board inside, which I think is kind of cool.) Several companies sell Pi 4 kits online for under $100 (keyboard and mouse not included). Another option is to purchase a Raspberry Pi 4 Official Desktop Kit which includes a keyboard and mouse (the plastic computer case, keyboard, and mouse are all a matching red and white color scheme). If you buy a Desktop kit, verify that it includes the heat sinks.
Figure 1 - Home Computer Coding Lab
To complete your Pi setup, you will also need to get a monitor or TV, a keyboard and mouse (unless you purchase a Desktop kit), and an electrical surge protector. Figure 1 shows a home computer coding lab that I set up for my niece's children. I recycled an old LCD TV and bought a colorful keyboard and a small-sized mouse (both designed for kids). I also bought a mousepad with the Raspberry Pi logo. For the lowest cost setup, see if someone you know has old computer equipment that you can have (monitor or TV, keyboard, mouse). If thats not possible, see if you can find a store in your area that sells used computer equipment, or check sites on the Internet such as Craigslist. In Chapter 2 Hardware Overview, you will find a complete list of the required equipment.
Scratch software versions In the summer of 2017, Scratch version 2.0 (or simply called Scratch 2) became available for the Pi. This was a major update to Scratch, and replaced the older Scratch version 1.4 (shown back in Figure 1 ). The layout of the main window for Scratch 2 is shown below in Figure 2 . In this book, you will learn how to use Scratch 2 (The newest software version, Scratch 3.0 will reportedly be available for the Raspberry Pi in 2020, and will be the topic of a future book in the Excited About Coding! series).
Figure 2 Scratch version 2 software
Raspberry Pi computer versions Figure 3 below lists the models that will run Scratch 2, and also shows the models that I recommend. The price difference between the models is not large (between $10 to $20).
Figure 3 - Pi models that run Scratch 2
Chapter 2: Hardware Overview
The Raspberry Pi is a very small computer, but it is surprisingly powerful and capable!