Unit6

Unit 6 - Physical Computing

In the Physical Computing unit, students further develop their programming skills, while exploring more deeply the role of hardware platforms in computing. Harkening back to the Input/Storage/Processing/Output model for a computer, students look towards modern “smart” devices to understand the ways in which non-traditional computing platforms take input and provide output in ways that couldn't be done with the traditional keyboard, mouse, and monitor.

Using App Lab and Adafruit’s Circuit Playground, students develop programs that utilize the same hardware inputs and outputs that we see in many modern smart devices, and they get to see how a simple rough prototype can lead to a finished product. The unit concludes with a design challenge that asks students to use the Circuit Playground as the basis for an innovation of their own design.

Modifications for Virtual and Socially-Distanced Classrooms

Are you teaching in a virtual setting or in a socially-distanced classroom?

We have modification recommendations for Unit 6, which include several options for adapting this physical computing unit to your classroom. Check out this document for ideas and resources to help you tailor common practices like Think Pair Share or Peer Feedback to your learning environment.

Chapter 1: Programming with Hardware

Big Questions

  • How does software interact with hardware?
  • How can computers sense and respond to their environment?
  • What kind of information can be communicated with simple hardware outputs?

Week 1

Lesson 1: Innovations in Computing

Research | Unplugged

  • Lesson Modifications
  • Warm Up (10 min)
  • Activity (45 min)
  • Wrap Up (2 min)
  • Extensions

In this lesson, students explore a wide variety of new and innovative computing platforms while expanding their understanding of what a computer can be.

Students Links: Activity Guide | Video | Video

Lesson 2: Designing Screens with Code

App Lab

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (45 to 60 minutes)
  • Wrap Up (5 min)

By reading and changing the content on the screen of an app, the class starts to build apps that only need a single screen. Even with just one screen, students can begin to see that these techniques allow for lots of user interaction and functionality.

Lesson 3: The Circuit Playground

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (45)
  • Wrap Up (5 min)

In this lesson, students get to know the Circuit Playground, the circuit board that will be used throughout the rest of this unit. Using App Lab, they develop programs that use the Circuit Playground for output.

Week 2

Lesson 4: Input Unplugged

Unplugged

  • Lesson Modifications
  • Warm Up (10 min)
  • Activity (40 min)
  • Wrap Up (2 min)

Students experience two different ways that an app can collect input from a user, while learning more about the event-driven programming model used in App Lab.

Students Links: Activity Guide

Lesson 5: Board Events

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (45 min)
  • Wrap Up (2 min)

Using the hardware buttons and switch, students develop programs that use the Circuit Playground as an input.

Lesson 6: Getting Properties

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (40 min)
  • Wrap Up (10 min)

This lesson introduces students to the getProperty block, which allows them to access the properties of different elements with code. They first practice using the block to determine what the user has input in various user interface elements. Students later use getProperty and setProperty together with the counter pattern to make elements move across the screen. A new screen element, the slider, and a new event trigger, onChange, are also introduced.

Lesson 7: Analog Input

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (10 min)
  • Activity (40 min)
  • Wrap Up (5 min)

Students get to explore the analog inputs on the Circuit Playground, writing programs that respond to the environment through sensors.

Students Links: Video

Week 3

Lesson 8: The Program Design Process

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (15 min)
  • Activity (45-60 min)
  • Wrap Up (20 min)

This lesson introduces students to the process they will use to design programs of their own throughout this unit. This process is centered around a project guide that asks students to sketch out their screens, identify elements of the Circuit Playground to be used, define variables, and describe events before they begin programming (a process very similar to the Game Design Process that students used in Unit 3). Students begin by playing a tug o' war style game where the code is hidden. They discuss what they think the board components, events, and variables would need to be to make the program. Then, they are then given a completed project guide that shows one way to implement the project, and are walked through this process in a series of levels. At the end of the lesson, students have an opportunity to make improvements to the program to make it their own.

Students Links: Project Guide

Lesson 9: Project - Make a Game

App Lab | Maker Toolkit | Project

  • Lesson Modifications
  • Warm Up (10 min)
  • Activity (90 - 120 min)
  • Wrap Up (10 min)

For this project, students design and create a game that leverages the new inputs and outputs that are available to them. This project is purposefully left very open-ended to empower students to think broadly about how physical output might be useful in an app, while still giving them a chance to review the program development process and try out the new features available through the Circuit Playground.

Teacher Links: Exemplars Students Links: Reflection | Project Guide | Rubric

Chapter Commentary

This unit begins with an activity that encourages students to explore a wide variety of non-traditional computing platforms, before kicking off a review of programming in App Lab, with a particular focus on better understanding the event-driven programming model that was first introduced in Unit 4. Students learn techniques to make the apps they write more flexible by modifying design elements through code instead of always relying on design mode. Using the Circuit Playground, they then explore different approaches to taking input and producing output using hardware. By the end of this chapter, students will design a develop a game that uses physical hardware for input and output.


Chapter 2: Building Physical Prototypes

Big Questions

  • How do programmers work with larger amounts of similar values?
  • How can complex real-world information be represented in code?
  • How can simple hardware be used to develop innovative new products?

Week 4

Lesson 10: Arrays and Color LEDs

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (45 min)
  • Wrap Up (5 min)

In this lesson, students are introduced to the ring of color LEDs, which are exposed as an array called colorLeds. Students learn how to access and control each LED in an array individually, preparing them to access multiple LEDs through iteration later in the chapter.

Lesson 11: Making Music

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm-Up (5 min)
  • Activity (40 min)
  • Wrap-Up (5 min)

In this lesson, students will use the Circuit Playground’s buzzer feature to its full extent by producing sounds, notes, and songs. Students start with a short review of the buzzer's frequency and duration parameters, then move on to the concept of musical notes. Notes allow students to constrain themselves to frequencies that are used in Western music and provide a layer of abstraction that helps them to understand which frequencies might sound good together. Once students are able to play notes on the buzzer, they use arrays to hold and play sequences of notes, and compose simple songs.

Lesson 12: Arrays and For Loops

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity (40 min)
  • Wrap Up

Students learn to combine lists and for-loops in this lesson, which allows them to write code that impacts every element of a list, regardless of how long it is. The class uses this structure to write programs that process all of the elements in lists, including the list of color LEDs.

Lesson 13: Accelerometer

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 Min)
  • Activity (45 min)
  • Wrap Up (5 Min)

In this lesson, students will explore the accelerometer and its capabilities. They’ll become familiar with its events and properties, as well as create multiple programs utilizing the accelerometer similar to those they’ve likely come across in real world applications.

Week 5

Lesson 14: Functions with Parameters

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up
  • Activity (50 min)
  • Wrap Up

This lesson starts with a quick review of parameters in the context of the App Lab blocks that students have seen recently. Students then look at examples of parameters within user-created functions in App Lab, and create and call functions with parameters to control multiple elements on a screen. Afterward, they use for loops to iterate over an array, passing each element into a function. Last, students use what they have learned to create a star catching game.

Lesson 15: Circuits and Physical Prototypes

App Lab | Maker Toolkit

  • Lesson Modifications
  • Warm Up (5 min)
  • Activity 1 (30 min)
  • Activity 2 (30-45 min)
  • Activity 3 (30-45 min)
  • Wrap Up (15 min)

In this lesson, students wire simple circuits to create a physical prototype using low-cost and easily-found materials.

Students Links: Video | Project Guide

Week 6

Lesson 16: Project - Prototype an Innovation

App Lab | Maker Toolkit | Project

  • Lesson Modifications
  • Warm Up (10 min)
  • Activity (80-200 min)
  • Wrap Up (30-60 min)
  • Extensions

This final project challenges students to develop and test a prototype for an innovative computing device that interacts with the physical world through various types of input and output, whichallow for interesting and unique user interactions. This project is an opportunity for students to showcase their technical skills, but they will also need to demonstrate collaboration, constructive peer feedback, and iterative problem solving as they encounter obstacles along the way. This project should be student-directed whenever possible, and provide an empowering and memorable conclusion to the final unit of CS Discoveries.

Teacher Links: Exemplars Students Links: Rubric | Reflection | Project Guide | Peer Review

Chapter Commentary

With an understanding of how to use hardware to take input and produce output, students move to thinking about more complex programs that integrate hardware and software. Using the color LEDs as an example of a a group of like objects, students learn how to use arrays to keep track of lists of values. From there we introduce the for loop, first simply as a way to repeat a block of code, and then as a way to run code on each element of an array. By the end of this chapter students will have explored all components of their boards while learning to structure their code using arrays, loops, and parametric functions. In the final two lessons students have an opportunity to dig into building physical prototypes using their boards.