100% found this document useful (2 votes)
350 views

Microbit Lesson 123

This document provides an introduction and overview for a 14-week computer science curriculum taught using micro:bit microcontrollers. It discusses how the curriculum focuses on practical problem-solving through projects rather than abstract math concepts. Each lesson includes an unplugged activity to introduce concepts, a micro:bit activity to apply skills, a student project, and connects to national computer science standards. The goal is for students to understand coding while developing skills like collaboration, problem-solving, and designing solutions that matter.

Uploaded by

jorge diaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
350 views

Microbit Lesson 123

This document provides an introduction and overview for a 14-week computer science curriculum taught using micro:bit microcontrollers. It discusses how the curriculum focuses on practical problem-solving through projects rather than abstract math concepts. Each lesson includes an unplugged activity to introduce concepts, a micro:bit activity to apply skills, a student project, and connects to national computer science standards. The goal is for students to understand coding while developing skills like collaboration, problem-solving, and designing solutions that matter.

Uploaded by

jorge diaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

An Introduction to

Computer Science with 1 -

BBC micro:bit
Lesson 1-3
Developed by Microsoft
INTRODUCTION
When we first started teaching computer science, we discovered two important things.
We found that existing curriculum for beginners focused mostly on solving math
problems or constructing geometric shapes and that there was a certain type of student
that signed up for computer science classes and these students were almost always
boys. We wondered whether a different approach to teaching the basics of computer
programming would be more engaging and also attract a larger variety of different types
of students, both boys and girls.

We decided to focus on what knowing how to program allowed you to do and create.
Ultimately all programs are created to solve a problem or serve a purpose. The problem
may be local or global, the purpose may be anything from helping doctors treat patients
to pure entertainment. By starting with interesting problems the students wanted to
solve, they were much more engaged in learning to code. They saw coding skills as an
important part of building creative solutions.

With this approach, we found that not only did we get more girls taking the course, we
also got a more diverse group of boys. Opportunities for collaboration increased, and all
the students got to see where their talents and skills meshed with others’ interests and
experiences, to make a whole that was greater than the sum of its parts.

We are now at the point where a third of the students taking computer science are
girls, and more importantly, students are coming out of the course not only with an
understanding of code, but also knowing how to read through professionally written
code, and take an idea from brainstorming through prototyping to build something that
matters.

- Authors Mary Kiang and Douglas Kiang


Course Introduction
This is an introduction to coding and computer science by way of making and design, using the
revolutionary new micro:bit microcontroller board, and Microsoft’s easy and powerful MakeCode block-
based coding environment. It is a project-based curriculum with a maker philosophy at its core; the idea is
that by making physical objects, students create a context for learning the coding and computer science
concepts.

Micro:bits may be purchased from these resellers: future study. They will develop powerful
http://microbit.org/resellers(you will need 1 design skills that they can use in future
micro:bit per student for this course). The “Micro:bit projects of all types, whether they are
Go Kit” includes a battery pack and USB cable as designing 3D printed prototypes or creating
well. apps that serve a real world purpose.

Other optional suggested micro: This course is targeted to middle school


1. Alligator/Crocodile clip cables grades 6-8 (ages 11-14 years). It is also written
2. Headphone/earbuds (for audio) for teachers who may not have a Computer
3. Servo motor (for movement) Science background, or may be teaching an
4. Croc clip to Male connector (for connecting “Intro to Computer Science” course for the
to Servo motor) first time.
5. Croc clip to Headphone jack adapter
http://microbit-accessories.co.uk/ This course takes approximately 14 weeks to
6. MakeCode for the micro:bit is a free web app complete, spending about 1 week on each of
https://makecode.microbit.org the first 11 lessons, and 3 weeks for students
to complete the final project at the end. Of
When students complete this course they will course, teachers should feel free to customize
have a good understanding of computer science the curriculum to meet individual school or
concepts that can serve as the foundation for district resources and timeframe.

Overall Course Scope & Sequence:


1. Making 7. Coordinate Grid System
2. Algorithms 8. Booleans
3. Variables 9. Bits, Bytes, and Binary
4. Conditionals 10. Radio
5. Iteration 11. Arrays
6. Review/Mini-Project 12. Independent Final Project
Each of the 12 lessons is comprised of the following Some students will finish the activity more quickly
parts: than others. Those students can then be a helpful
• Topic Introduction resource for their classmates, or they can challenge
• Unplugged Activity (30 min) - An offline game or themselves by modifying, or “modding” the activity to
activity that demonstrates the concept/topic do something different. We have provided examples
• Micro:bit Activity (45–60 min) - An offline game and suggestions at the end of many of these activities,
or activity that evryone makes on their micro:bit and feel free to suggest your own (or encourage your
that teaches the skills learned in this lesson. students to come up with their own ideas!)
• Project (60–120 min) - A prompt for an original
project that each student will create to Project (60–120 min)
demonstrate their understanding of the skills and After presenting the concept in an unplugged fashion,
concpts covered in this lesson. then walking students through a demonstration
• Assessment - A project rubric and guicance for activity, it is time to challenge students to use those
grading the project. skills to create something that is creative and original.
• Standards - A list of CSTA K-12 Computer Students will be working on their projects in a
Science Standards and /or concepts covered by “collaboratively that is creative and original. Students
this lesson. will be working on their projects in a “collaboratively
independent” way, which means each student is
responsible for turning in his or her own project, but
are encouraged to work together and help each other
Topic Introduction while doing so. Some form of reflection is an important
The introduction to each lesson will tell you what part of documenting the learning that has taken place,
learning objectives are covered in the lesson, and and it’s a great idea to share out the final projects and
presents an overview of that lesson’s topic. Some reflections, either at an event or on a blog.
lessons have a specific activity that can help
introduce the topic to students in a fun way. There are also a series of Project Mods that students
can do to extend the project they have created.
These are useful for students who already have
Unplugged Activity (30 min) some experience with coding or who want an extra
challenge.
Each lesson starts with an unplugged activity, which
doesn’t require a computer or a micro:bit. It’s a
chance to get students up and moving around, and Assessment
is designed to be a fun introduction to the computer
science concept covered in that lesson. Unplugged A rubric is provided for each project that can be
activities are an important way to demonstrate customized according to what students are being
new concepts in a tangible, often kinesthetic, way. asked to demonstrate. For the Activities we just
Since so many computer-based topics are abstract, expect students to do them, so those are fairly simple
unplugged activities are very effective at fostering to check off. For the Projects, however, there is often
understanding that students will then demonstrate in a range of grades based on how closely the project
later activities. meets the specifications of the assignment.

Micro:bit Activity (45–60 min) Standards

Each lesson also contains a micro:bit activity, which Where applicable, we have mapped each of
we informally refer to as a “birdhouse” activity, after the lessons to the Computer Science Teachers
the innumerable wooden birdhouses so many of us Association (CSTA) K-12 Standards, which are US
made in wood shop as a way to master basic skills. nationally recognized standards for computer science
Each lesson’s micro:bit activity is an example that education.
walks students step-by-step through building a
project that demonstrates that lesson’s topic. By the
time students finish the activity, they will have written
code that they can use in a different project of their
own design.
REFERENCES
We have included some additional reference books and materials if you are
interested in learning more about Maker Education, Physical Computing or Design
Thinking in the classroom.

• Invent To Learn
Making, Tinkering, and Engineering in the Classroom by Sylvia Libow Martinez
& Gary Stager
• Launch
Using Design Thinking to Boost Creativity and Bring Out the Maker in Every
Student by John Spencer and AJ Juliani
• The Innovator’s Mindset
Empower Learning, Unleash Talent, and Lead a Culture of Creativity by George
Couros
• The Big Book of Makerspace Projects
Inspiring Makers to Experiment, Create, and Learn by Colleen Graves

If you have feedback for the Microsoft MakeCode team, you can fill our their survey
form here: https://aka.ms/microbitfeedback

The support site for the micro:bit is located here: https://support.microbit.org/

Douglas Kiang is a speaker, teacher, and workshop


presenter with twenty-seven years of teaching
experience in independent schools at every grade
level. He currently teaches high school computer
science at Punahou School in Honolulu, Hawaii.
Douglas hold a Master’s degree in Technology,
Innovation, and Education from Harvard and is a
Microsoft Innovative Educator.

You can follow him on Twitter at @dkiang.

Mary Kiang has been teaching for over twenty-five


years at elementary, middle, and high school levels.
She also developed curriculum in the Education
Department of the Museum of Science in Boston.
She currently teaches 6th grade Math/Science at
Punahou School. Mary is a former programmer
for Houghton Mifflin and Dun & Bradstreet and
holds a Master’s degree in Elementary Education
from Simmons College. Mary is the founder of GO
Code!, an organization that supports girls and young
women in exploring coding and STEM.
Making with Micro:bit

This Lesson introduces the Micro:bit as a piece of hardware that has a specific size and weight, and
generally must be supported and incorporated as an essential component of a tangible artifact. Focus on
incorporating the physical Micro:bit into a basic making activity.

Lesson Objectives

• Exercise creativity and resourcefulness by coming up with ideas for using simple household materials
’ z
• Test and iterate using different materials and sizes in order to create an optimal design to house the
micro:bit and battery pack
• Learn how to download programs and move them to the Micro:bit file to run on the Micro:bit.
• Use the design thinking process to develop an understanding for a problem or user need.
• “ ”

Lesson Plan Structure


• Introduction: The Micro:bit is for making
• Unplugged Activity: Design Thinking
• Micro:bit Activity: MakeCode download
• Project: Micro:pet
• Project Mods
• Assessment: Rubric
• Standards: listed

Introduction
The Micro:bit is a great way to teach the basics of programming and computer science. The Microsoft
MakeCode block-based coding environment is a powerful and intuitive way to make the Micro:bit react to
all sorts of input, and you can introduce fundamental concepts such as iteration, conditional statements,
and variables using MakeCode.

Students often focus primarily on the 5x5 LED screen for providing output. Although this is the most
directly accessible way to see a reaction to some kind of input, there are many more creative possibilities
“ ” ,
creations.

01.Making Page 8
’ I’
common household supplies. Because the micro:bit is so lightweight, and supports so many sensors, it can
be incorporated easily into a physical design as long as students plan ahead for its size and weight. One of
q “W ?”

I ’ , “ ”
We purposely start this course with a lesson on Making and the physical nature of the micro:bit, because it
is important to set the tone for the whole course that this is a class about making, building, crafting and
construction. It helps if you have an art room available where kids can work, or arts and crafts supplies in
your classroom that kids can use to build.

Some common making supplies to gather:


• pizza boxes
• scrap cardboard
• colored construction paper
• colored duct tape
• scissors
• pipe cleaners
• stickers
• feathers
• string
• markers

01.Making Page 9
Unplugged: Design Thinking

Objective: To introduce a process of design that starts with talking to one another. Whatever
you build with code should serve a purpose or fill a need. Sometimes what you build will make
the world more beautiful, or help somebody else. Our design process, based on a process called
design thinking, can give students a specific framework for thinking purposefully about design.

Overview: In this activity, students will interview each other about their ideal pet. They should
take notes.
’ ,
create prototypes that get you closer and closer to the best solution.

Materials:
Pairs of students, something to take notes on

Getting started:
Pair students up with each other. One is Student A, the other is Student B. The goal of this
activity is to gather information from their partner that will help them to design a Micro:bit pet
for their partner.

5 minutes: Student A interviews Student B. The goal is to find out what Student B considers to
be their ideal pet. Student A should mostly listen, and ask questions to keep Student B talking
for the entire time. Here are some questions to start with:

• Do you have a pet? What is it?


• What do you like about your pet? What do you dislike?
• Is there anything you wish your pet could do? Why?
• Tell me about your ideal pet.

5 minutes: Student B interviews Student A, as above.

q “W ?”

01.Making Page 10
q “W ?”
as possible. Your partner will tell you about his or her ideal pet, but you are really finding out
’ W ,
people. So we need to start with understanding them first.

5 minutes: Student A and Student B review their notes, and circle anything that seems as if it will
be important to understanding how to create the ideal pet for their partner. Circle ideas, advice,
anything that could be helpful when they start building. Then, they should use what they have
discovered about their partner to fill in the blanks:

"My partner needs a __________________ because __________________."

This definition statement should draw some conclusions about their partner's need based on the
conversation they have had with that person.

5 minutes: Student A and Student B sketch at least 5 ideas of pets that would meet their
partner's needs. Stick figures and diagrams are okay. At this point, quantity is more important
than quality. Students shouldn't limit themselves to real animals; unicorns and mashups are
totally fine!

Make sure students keep their notes and sketches! They will use them in the project for this
lesson.

Examples

01.Making Page 11
01.Making Page 12
01.Making Page 13
Activity: Installing a Program

Micro:bit Activity: Installing a Microsoft MakeCode Program on the Micro:bit

Objective: Learn how to download programs from the MakeCode tool.

Overview: Students will create a simple program in Microsoft MakeCode and download it to
their Micro:bit using a USB cable.

For this activity, students will each need a Micro:bit, a micro-USB cable, a computer, and a
battery pack.

Download this file to your computer (right-click, Save As):

microbit-Mi
croPet

Open a browser window to makecode.com, and select the micro:bit code editor

From the top left corner of the screen, select the Projects Menu, and click on Import File.
Select the file that you saved on your computer in the previous step.

01.Making Page 14
Select the file that you saved on your computer in the previous step.

The program should look like the following in MakeCode.


It shows a repeating series of faces:

basic.forever(() => {
basic.showIcon(IconNames.Happy)
basic.pause(5000)
basic.showIcon(IconNames.Sad)
basic.pause(5000)
})

MicroPet

01.Making Page 15
Tour of Microsoft MakeCode
• Simulator - on the left side of the screen, you will see a virtual micro:bit that will show what
your program will look like running on a micro:bit. This is helpful for debugging, and
instant feedback on program execution.
• Toolbox - in the middle of the screen, there are a number of different categories, each
containing a number of blocks that can be dragged into the programming workspace on
the right.
• Workspace - on the right side of the screen is the Programming Workspace where you will
create your program. Programs are constructed by snapping blocks together in this area.

The color of the blocks identifies their category. All of the blocks that make up the program
above come from the Basic Toolbox category, which is light blue.

Downloading a MakeCode Program to the micro:bit


’ B
micro-USB cable. The micro:bit will draw power from your computer through the USB
connection, or you can connect an optional battery pack so it can function even after it is
unplugged from the computer. Once plugged in, the micro:bit shows up on your computer like
a USB flash drive.

01.Making Page 16
a USB flash drive.

Click the purple Download button in the lower left of the MakeCode screen. This will download
the file to your computer, to the location where your browser is set to save downloads.

To move the program to your micro:bit, drag the downloaded "microbit-xxxx.hex" file to the
MICROBIT drive, as if you were copying a file to a flash drive. The program will copy over, and it
will begin running on the micro:bit immediately.

The micro:bit will hold one program at a time. It is not necessary to delete files off the micro:bit
before you copy another onto the micro:bit; a new file will just replace the old one.

For the next project, your students should attach the battery pack (it takes 2 AAA batteries) to
the micro:bit using the white connector. That way they can build it into their design without
having to connect it to the computer.

01.Making Page 17
01.Making Page 18
Project: Micro:pet

Project
This project is an opportunity for students to create a micro:pet for the partner they interviewed in the
Unplugged activity. They should review their notes and try to summarize what their partner finds appealing in a
pet. Then, they should use whatever materials are available to create a prototype of a pet their partner would
like.

We often ask students to sketch a few designs on paper first, then consult with their partner to see which
aspects of those designs they find most appealing. The purpose of prototyping is to gather more feedback to
“I I , I I B…”

Build a micro:pet that:


• ’
• Supports the micro:bit and its battery pack
• Allows you to easily access the micro:bit to turn it on and off

Your design should use whatever materials are available to support the micro:bit so that its face is showing. You
can be creative and decide how to mount the board, and how to decorate your critter.

Think about the following questions when you construct it:


• Will it be an animal? A plant? A robot? A bug?
• Will it have any moving parts?
• If it moves, how can you hold the micro:bit securely?

Some photos of sample micro:pets below!

Ideas for Mods


• Find a way to make part of the animal move.
• Give your animal a natural habitat.
• Create a way to carry your animal.
• Create an animal that reacts when you pet it or move it (find a way to detect when the micro:bit is moved
or when its position changes in a certain way.)

Reflection
Have students write a reflection of about 150–300 words, addressing the following points:
• Summarize the feedback you got from your partner on your idea. How would you revise your design, if
you were to go back and create another version?
• What was it like to have someone designing a pet for you? Was it a pet you would have enjoyed? Why or
why not? What advice did you give them that might help them redesign?
• What was it like to interview your partner? What was it like to be listened to?
• What was something that was surprising to you about the process of designing the micro:pet?
• Describe a difficult point in the process of designing the micro:pet, and explain how you resolved it.

Rubric
For creative projects such as these, we normally don’t use a qualitative rubric to grade the creativity or the
match with their partner’s needs. We just check to make sure that the micro:pet meets the required
specifications:
Program properly downloaded to micro:bit

01.Making Page 19
• Program properly downloaded to micro:bit
• Micro:bit supported so the face is showing
• Micro:bit can be turned on and off without taking critter apart
• Turned in notes on interview process
• Written reflection (prompt is above)

Micro:Pet Examples

Dog

micro:pet Fish Tank

01.Making Page 20
Pink Piggy

Ladybug

01.Making Page 21
Caterpillar

Fox

01.Making Page 22
Robot

01.Making Page 23
Standards

CSTA K-12 Computer Science Standards

• 2-A-2-1 Solicit and integrate peer feedback as appropriate to develop or refine a program

• 2-A-6-10 Use an iterative design process (e.g., define the problem, generate ideas, build,
test, and improve solutions) to solve problems, both independently and collaboratively.

01.Making Page 24
Algorithms

This lesson introduces a conceptual framework for thinking of a computing device as something that uses code to
process one or more inputs and send them to an output(s).

Lesson Objectives

• Understand the four components that make up a computer and their functions.
• Understand that the micro:bit takes input, and after processing the input, produces output.
• Learn the variety of different types of information the micro:bit takes in as input.
• Apply this knowledge by creating a micro:bit program that takes input and produces an output.

Introduction
What is a micro:bit?
The micro:bit was created in 2015 in the UK by the BBC to teach computer science to students. The BBC gave away a
micro:bit to every Year 7 student in the UK. You can think of a micro:bit as a mini computer.
http://microbit.org

What is a computer?
There are 4 main components that make up any computer:

02.Algorithms Page 25
1. The Processor – this is usually a small chip inside the computer, and it’s how the computer processes and
transforms information. Has anyone heard of the term “CPU”? CPU stands for Central Processing Unit. You can
think of the processor as the Brains of the computer - the faster the processor, the more quickly the computer
can think.

2. The Memory – this is how the computer remembers things. There are two types of memory:
○ RAM (random access memory) - you can think of this as the computer’s short-term memory
○ Storage (also referred to as the “hard drive”) - this is the computer’s long-term memory, where it can store
information even when power is turned off

3. Inputs – this is how a computer takes in information from the world. On humans, our input comes in through
our senses, such as our ears and eyes. What are some Computer Inputs? Keyboard, Mouse, Touchscreen,
Camera, Microphone, Game Controller, Scanner

4. Outputs – this is how a computer displays or communicates information. On humans, we communicate


information by using our mouths when we talk. What are some examples of communication that don't involve
talking? Blushing, sign language. What are some examples of Computer outputs? Monitor/Screen,
Headphones/Speakers, Printer

Now, let’s look at our micro:bit:

• Use the diagram here as a visual aid: http://microbit.org/hardware/


• Can you find the Processor?
• How much memory does the micro:bit have? 16K, which is smaller than many files on your computer!
• Can you locate the following Inputs? Buttons (on board), Pins (at base), Accelerometer / Compass
○ Though not pictured, the Light Sensor is located on the LED lights
• Where are the Outputs? LED lights, Pins

All computers need electricity to power them. There are 3 ways to power your micro:bit:
• Through the USB port at the top
By connecting a battery pack to the battery connector

02.Algorithms Page 26
• By connecting a battery pack to the battery connector
• Through the 3V Pin at the bottom (not the recommended way to power your micro:bit)

On the top left corner you may notice that your micro:bit has a Bluetooth antenna. This means your micro:bit can
communicate and send information to other micro:bits. We will learn more about this feature in the Radio Lesson.

02.Algorithms Page 27
Unplugged: What's Your Function & Crazy Conditionals

Materials
• Pencils
• Paper (or index cards)

In computer programming, algorithms are sets of instructions.

‘ ’ , ,

‘ ’

A function machine takes an input, processes the input, and then delivers an output.

The inputs and their outputs are usually recorded in an input output table, where the value of x represents the
input and the value of y represents the output. See example.

02.Algorithms Page 28
input and the value of y represents the output. See example.

Input (x) Output (y)


1 2
2 4
3 6
4 8

A common math problem is to determine what processing is happening to the input that results in the given
output. In the example above, each input is being doubled (multiplied by 2) to produce the corresponding output.

Input (x) Processing => Output (y)


1 *2 2
2 *2 4
3 *2 6
4 *2 8

Unplugged: What's Your Function?


For this activity, the students can work in pairs, Player A and Player B. The pairs will take turns being the function
machine for their partner who will be providing input to be processed.

Direct the students how you would like them to record their work.
They can use pencil and paper or index cards.
On paper, they can keep track of inputs and outputs in a table (see example above).
With index cards, Player A can write each input on one side of an index card, hand the card to Player B, who then
writes the corresponding output on the other side of the card.

To begin:
• Player B decides on a mathematical function or bit of processing* that will be done on whatever input she
receives from Player A.
• Player B should write down the function or bit of processing and set it aside, out of sight of Player A.
• Player A then gives Player B a number to process.
• Player B processes the number and returns an output to Player A.
• Player A can then state what function or bit of processing she thinks Player B is using on the input to produce
the given output. One try per round of input/output.
• If Player A states the correct function, Player B confirms that it is correct by showing the previously hidden
function and the players switch roles and start the game over.
• If Player A does not guess correctly, Player A provides another input that Player B processes and provides an
output for.
• The goal is for Player A to figure out what function or bit of processing Player B is using in the fewest number
of rounds of input/output possible.
• After each student has had at least one chance to be the function machine, play more rounds as time permits.

Notes:
• The difficulty level of the possible functions should be determined by the teacher and shared with the
students ahead of playing. Alternately, the teacher can provide function cards that are handed out at random
to be used by the players, rather than the players creating their own.
The player providing the input should not just guess what the function is. She should be able to explain why

02.Algorithms Page 29
• The player providing the input should not just guess what the function is. She should be able to explain why
she thinks her input resulted in the given output.
• ‘ ’
○ Add 8
○ Subtract 6
○ Multiply by 3
○ Divide by 2
• Examples of more difficult functions:
○ Multiply by 2 and then subtract 1
○ Square the input
○ Return 20% of the input

Unplugged: Crazy Conditionals


This is a fun, interactive exercise to introduce conditionals and event handlers as computer processing. Read
through the entire activity and adjust as needed for your class and classroom.

Preparation:
• Print & cut into strips with one conditional on each strip
• Note that some of the same conditionals can be given to multiple students, while other conditionals are to be
given to just one student.
• ‘B GIN’ , RIN ID DOWN
• B ‘B GIN’ ‘ O ’ ,
this is that it is challenging for a student to keep track of a lot of different conditionals, though not so for a
computer! : )

Notes:
• Some of the same conditionals can be given to multiple students, while other conditionals are to be given to
just one student.
• Technically these conditionals are all event handlers because the students are simply waiting for a specific
event to trigger them into action.
• Unless instructed otherwise, students do not speak or make noise during this activity.

Extensions/Variations:
• Add AND, OR, AND/OR statements to the conditionals.
• IF’
• L IF’
• Relate this activity to a system and have the students create the conditionals that would end in a product of
some kind or the completion of some task.

Give these 2 conditionals to all students.


• These 2 conditionals will be triggered only once.
• These conditionals start and stop this activity.
• G ‘B GIN’ RIN ID

IF ‘BEGIN’ on the whiteboard,


THEN flip over the conditionals in front of you and follow the directions.

IF ‘STOP’ on the whiteboard,


THEN sit back, cross your arms, and look at the teacher (smile!).

=================================================================

02.Algorithms Page 30
Give these 6 conditionals to multiple students.
• These 6 conditionals may be triggered more than once.
• Walk around the classroom during the activity to trigger some of these conditionals.

IF ‘ ’,
THEN ‘ !’

IF any student stands up for any reason,


THEN clap 3 times.

IF anyone writes on the whiteboard with a GREEN marker,


THEN get up and touch something GREEN in the room and sit back down.

IF anyone walks past you while you are seated,


THEN snap your fingers 3 times.

IF someone snaps their fingers AND ‘ ’ ,


THEN select a book from the bookcase and sit back down.

IF anyone writes anything on the whiteboard,


THEN get up and turn around in place one full turn and sit back down.

=================================================================

Give one student each of the following 7 conditionals.


• These 7 conditionals will be triggered only once and set in motion the spelling of STOP on the whiteboard.

IF the teacher picks up a book,


THEN get up and write the letter S on the whiteboard and sit back down.

IF someone writes the letter S on the whiteboard,


THEN go open and close the classroom door and sit back down.

IF someone opens and closes the classroom door,


THEN get up and write the letter T (after the letter S) on the whiteboard.

IF someone writes the letter T on the whiteboard,


THEN get up and turn the lights on and off and sit back down.

IF someone turns on and off the lights,


THEN get up and write the letter O (after the letter T) on the whiteboard.

IF someone writes the letter O on the whiteboard,


THEN get up and sharpen a pencil.

IF someone sharpens a pencil,


THEN get up and write the letter P (after the letter O) on the whiteboard.

02.Algorithms Page 31
Activity: Happy Face, Sad Face

The micro:bit itself is considered hardware. It is a physical piece of technology. In order to


make use of hardware, we need to write software (otherwise known as "code" or computer
programs). The software "tells" the hardware what to do, and in what order to do it using
algorithms. Algorithms are sets of computer instructions.

In this activity, we will discover how to use the micro:bit buttons as input devices, and write code
that will make something happen on the screen as output. We will also learn about pseudocode,
the MakeCode tool, event handlers, and commenting code.

Pseudocode
What do you want your program to do?
The first step in writing a computer program is to create a plan for what you want your program
to do. Write out a detailed step-by-step plan for your program. Your plan should include what
type of information your program will receive, how this input will be processed, what output
your program will create and how the output will be recorded or presented. Your writing does
not need to be written in complete sentences, nor include actual code. This kind of detailed
writing is known as pseudocode. Pseudocode is like a detailed outline or rough draft of your
program. Pseudocode is a mix of natural language and code.

For the program we will write, the pseudocode might look like this:
• Start with a blank screen
• Whenever the user presses button A, display a happy face.
• Whenever the user presses button B, display a sad face.

Microsoft MakeCode
Now that you have a plan for your program, in the form of pseudocode, let's start creating the
real program. In a browser window, open the Microsoft MakeCode for micro:bit tool
(https://makecode.microbit.org). The MakeCode tool is called an IDE (Integrated Development
Environment), and is a software application that contains everything a programmer needs to
create, compile, run, test, and even debug a program.

Tour of Microsoft MakeCode


• Simulator - on the left side of the screen, you will see a virtual micro:bit that will show what
your program will look like running on a micro:bit. This is helpful for debugging, and
instant feedback on program execution.
• Toolbox - in the middle of the screen, there are a number of different categories, each
containing a number of blocks that can be dragged into the programming workspace on
the right.
• Workspace - on the right side of the screen is the Programming Workspace where you will
create your program. Programs are constructed by snapping blocks together in this area.

02.Algorithms Page 32
Event handlers
W , ,‘ ’ ‘ ’
coding workspace. These two blocks are event handlers.

In programming, an event is an action done by the user, such as pressing a key or clicking a
mouse button. An event handler is a routine that responds to an event. A programmer can
write code telling the computer what to do when an event occurs.

One fun unplugged activity you can do with kids to reinforce the idea of an action that waits for
an event is the Crazy Conditionals activity.

Notes:
• Tooltips - Hover over any block until a hand icon appears and a small text box will pop up
Y ‘ ’ ‘ ’
blocks. Notice that it also shows you the equivalent code in JavaScript.

Hovering over the code in JavaScript has the same effect.

• Help/Documentation - You can also right-click on any block and select Help to open the
reference documentation.

02.Algorithms Page 33
reference documentation.

• Deleting blocks - Click on the 'forever' block and drag it left to the Toolbox area. You
should see a garbage can icon appear. Let go of the block and it should disappear. You
can drag any block back to the Toolbox area to delete it from the coding workspace. You
can also remove a block from your coding window by selecting the block and then
pressing the "delete" key on your keyboard (or command-X on a mac).

Looking at our pseudocode, we want to make sure to start a program with a clear screen.

• We can do this by going to the Basic menu -> ‘ ’

• D ‘ ’ W
N ‘ ’ I ‘ ’ ,
box will appear letting you know that since this block is not attached to an event handler
block, it will not run.

• G ‘ ’ ‘ ’ N
longer grayed out, indicating that it will run when the event, the program starts, occurs.

basic.clearScreen()

Save early, save often!


We now have a working program running on the micro:bit simulator!
As you write your program, MakeCode will automatically compile and run your code on the
’ , ,
we should name our program and save it.

02.Algorithms Page 34
On the bottom left of the application window, to the right of the Download button, is a text box
in which you can name your program. After naming your program, press the save button to save
it.

Important: Whenever you write a significant piece of code or just every few minutes, you should
save your code. Giving your code a meaningful name will help you find it faster from a list of
programs and will let others know what your program does.

More event handlers


Now to make our program a bit more interesting by adding two more event handlers.
• F I , ‘ ’
Notice that the second block is grayed out. This is because, right now, they are the same
, ‘ ’ ‘ ’

• Leave the first block alone for now, and using the drop-down menu within the second
, ‘ ’ ‘B’ N ,
,‘ B ’

input.onButtonPressed(Button.A, () => {
})
input.onButtonPressed(Button.B, () => {
})

Show LEDs
Now we can use our LED lights to display different images depending on what button the user
presses.
• F B , ‘ ’
• ‘ ’ ‘ ’
‘ ’ ‘ B ’

input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. . . . .
. . . . .

02.Algorithms Page 35
. . . . .
. . . . .
. . . . .
. . . . .
`)
})
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
})

• ‘ ’ ‘

• ‘ ’ ‘ B

input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. . . . .
. # . # .
. . . . .
# . . . #
. # # # .
`)
})
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. . . . .
. # . # .
. . . . .
. # # # .
# . . . #
`)
})

Test your program!


Remember, MakeCode automatically compiles and runs your program, so all you need to do
now is press button A and then button B in the simulator to see the output produced by your
code.
• F L D ‘ ’
the images you want.
• Remember to save your code.

02.Algorithms Page 36
Commenting your code
It is good practice to add comments to your code. Comments can be useful in a number of
ways. Comments can help you remember what a certain block of code does and/or why you
chose to program something the way you did. Comments also help others reading your code to
understand these same things.

To comment a block of code:


• Right-click on the icon that appears before the words on a block.
• ‘ ’

• This will cause a question mark icon to appear to the left of the previous icon.
• Click on the question mark and a small yellow box will appear into which you can write
your comment.

• Click on the question mark icon again to close the comment box when you are done.
• Click on the question mark icon whenever you want to see your comment again or to edit
it.

Notes
• When you right-click on the icon that appears before the words on a block, notice that
there are other options available to you that allow you to duplicate and delete blocks, as
well as get help. Feel free to explore and use these as you code.

02.Algorithms Page 37
well as get help. Feel free to explore and use these as you code.
• In JavaScript, you can add a comment by using two forward slashes, then typing your
comment. The two forward slashes tell JavaScript that the following text (on that same line)
is a comment.
// Display a happy face when button A is pressed.

Cleaning up!
Clean up your coding workspace before you do a final save! What does this mean?
• It means that only the code and blocks that you are using in your program are still in the
workspace.
• Remove (delete) any other blocks that you may have dragged into the coding workspace
as you were experimenting and building your program.

Save and Download


Now that your code is running just fine in the simulator, is commented, and your coding window
‘ ’, , , !

Here is the complete program:

// Display a happy face when button A is pressed.


input.onButtonPressed(Button.A, () => {
basic.showLeds(`
. . . . .
. # . # .
. . . . .
# . . . #
. # # # .
`)
})
// Display a sad face when button B is pressed.
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
. . . . .
. # . # .
. . . . .
. # # # .
# . . . #
`)
})
basic.clearScreen()

HappySadFace

02.Algorithms Page 38
02.Algorithms Page 39
Project: Fidget Cube

A fidget cube is a little cube with something different that you can manipulate on each surface.
, , , “ ” ,
pull, press, and play with it. In this project, students are challenged to turn the micro:bit into
“ ”

Show students some examples of fidget cubes:


• Original Kickstarter Fidget Cube - https://www.kickstarter.com/projects/antsylabs/fidget-
cube-a-vinyl-desk-toy (there is a funny video showing the fidget cube in action).

Discussion questions
• Do any of your students fidget?
• What kinds of things do they fidget with? Spinning pens, fidget spinners, rings, coins?
• There are many different versions of fidget cubes available now. Do any students have
any?
• Have they seen them before?
• What are the types of fidget activities?
• If students could add or modify features of the fidget cube, what would they choose to
do?
• What would make the ultimate fidget cube?

Remind students that a computing device has a number of inputs, and a number of outputs. The
code that we write processes input by telling the micro:bit what to do when various events
occur.

Project
Make a fidget cube out of the micro:bit, create a unique output for each of the following inputs:
• on button A pressed
• on button B pressed
• on button A+B pressed
• on shake

See if you can combine a maker element similar to what you created in Lesson 1 by providing a
holder for the micro:bit that holds it securely when you press one of the buttons.

02.Algorithms Page 40
Sample Fidget Cube designs

Project Mod
• Add more inputs and more outputs - use more than 4 different types of input. Try to use
other types of output (other than LEDs) such as sound!

Assessment

4 3 2 1
Inputs At least 4 different At least 3 At least 2 Fewer than 2
inputs are different inputs different inputs different inputs are
successfully are successfully are successfully successfully
implemented implemented implemented implemented
Outputs At least 4 different At least 3 At least 2 Fewer than 2
outputs are different outputs different outputs different outputs
successfully are successfully are successfully are successfully
implemented implemented implemented implemented
Micro:bit Micro:bit program: Micro:bit program Micro:bit program Micro:bit program
program • uses event lacks 1 of the lacks 2 of the lacks all or of the
handlers in a way required elements required elements required elements
that is integral to
the program
• compiles and runs
as intended,
• includes
meaningful
comments
Collaboration Reflection piece Reflection piece Reflection piece Reflection piece
reflection includes: lacks 1 of the lacks 2 of the lacks 3 of the
• brainstorming required elements required elements required elements
ideas

02.Algorithms Page 41
ideas
• construction
• programming
• beta testing

02.Algorithms Page 42
Standards

CSTA K-12 Computer Science Standards

• CT.L2-03 Define an algorithm as a sequence of instructions that can be processed by a


computer.

• CD.L2-01 Recognize that computers are devices that execute programs.

• CD.L2-02 Identify a variety of electronic devices that contain computational processors.

• CD.L2-03 Demonstrate an understanding of the relationship between hardware and


software.

• CD.L3A-04 Compare various forms of input and output.

02.Algorithms Page 43
Variables

This lesson introduces the use of variables to store data or the results of mathematical
operations. Students will practice giving variables unique and meaningful names. And we will
introduce the basic mathematical operations for adding subtracting, multiplying, and dividing
variables.

Lesson Objectives

• Understand what variables are and why and when to use them in a program.
• Learn how to create a variable, set the variable to an initial value, and change the value of
the variable within a micro:bit program.
• Learn how to create meaningful and understandable variable names.
• Understand that a variable holds one value at a time.
• Understand that when you update or change the value held by a variable, the new value
replaces the previous value.
• Learn how to use the basic mathematical blocks for adding, subtracting, multiplying, and
dividing variables.
• Apply the above knowledge and skills to create a unique program that uses variables as
an integral part of the program.

Lesson Plan Structure


• Introduction: Variables in daily life
• Unplugged Activity: Rock Paper Scissors scorekeeping activity
• Micro:bit Activity: Make a game scorekeeper
• Project: Make a scorekeeper
• Project Mods
• Assessment: Rubric
• Standards: Listed

Introduction
Computer programs process information. Some of the information that is input, stored, and
used in a computer program has a value that is constant, meaning it does not change
throughout the course of the program. An example of a constant ‘ ’ ‘ ’
has one value that never changes. Other pieces of information have values that vary or change
during the running of a program. Programmers create variables to hold the value of
information that may change. In a game program, a variable may be created to hold the
’ , !
game.

Ask the students to think of some pieces of information in their daily life that are constants and

03.Variables Page 44
Ask the students to think of some pieces of information in their daily life that are constants and
others that are variables.
• W ’
day (constants)?
• What pieces of information have values that do change during the course of a single day
(variables)
Constants and variables can be numbers and/or text.

Examples
I …
• , , ’ , ’
• Variables: The temperature/weather, the current time, the current class, whether they are

Variables hold a specific type of information. The micro:bit's variables can keep track of
numbers, strings, booleans, and sprites. The first time you use a variable, its type is assigned to
match whatever it is holding. From that point forward, you can only change the value of that
variable to another value of that same type.
• A number variable could hold numerical data such as the year, the temperature, or the
degree of acceleration.
• A string variable holds a string of alphanumeric characters such as a person's name, a
password, or the day of the week.
• A boolean variable has only two values: true or false. You might have certain things that
happen only when the variable called gameOver is false, for example.
• A sprite is a special variable that represents a single dot on the screen and holds two
separate values for the row and column the dot is currently in.

03.Variables Page 45
Unplugged: Keeping Score

To experience creating and working with variables, have students pair up and play Rock Paper
Scissors.

Ask students to keep track of their scores on paper.


You can also have students play in groups of three with the third student acting as the
scorekeeper.

Students will keep track of how many times each player wins as well as the number of times the
players tie.

Play: Have students play Rock Paper Scissors for about a minute. When done, ask the students
‘ ’

Play again: Tell students they will now start over and play again for another minute. When
, ‘ ’

Ask some students to share how they kept track of player scores.
, ’
, ‘ ’
made a separate place for recording ties.

03.Variables Page 46
Sample Score-keeping sheet

Ask the students what parts of the score sheet represent constants, values that do not change

Ask the students what parts of the score sheet represent variables, values that do change

03.Variables Page 47
Activity: Scorekeeper

This Micro:bit activity guides the students to create a program with three variables that will keep score for their Rock
Paper Scissors game.

Tell the students that they will be creating a program that will act as a scorekeeper for their next Rock Paper Scissors
game. They will need to create variables for the parts of scorekeeping that change over the course of a gaming
session. What are those variables?
• The number of times the first player wins
• The number of times the second player wins
• the number of times the players tie

Creating and naming variables: Lead the students to create meaningful names for their variables.
• What would be a unique and clear name for the variable that will keep track of the number of times Player A
wins?
• ‘ W’, ’, ‘ B ’, ‘ B ’, ‘ W ’
• Discuss why (or why not) different suggestions make clear what value the variable will hold. In general, variable
names should clearly describe what type of information they hold.

In MakeCode, from the Variables menu, make and name these three variables: PlayerAWins, PlayerBWins, PlayersTie

Initializing the variable value


It is important to give your variables an initial value. The initial value is the value the variable will hold each time the
program starts. For our counter program, we will give each variable the value 0 (zero) at the start of the program.

03.Variables Page 48
let PlayerAWins = 0
let PlayerBWins = 0
let PlayersTie = 0

Updating the variable value


In our program, we want to keep track of the number of times each player wins and the number of times they tie. We
can use the buttons A and B to do this.
Pseudocode:
• Press button A to record a win for player A
• Press button B to record a win for player B
• Press both button A and button B together to record a tie

We already initialized these variables and now need to code to update the values at each round of the game.
• Each time the scorekeeper presses button A to record a win for Player A, we want to add 1 to the current value of
‘ W ’
• Each time the scorekeeper presses button B, to record a win for Player B, we want to add 1 to the current value
‘ BW ’
• Each time the scorekeeper presses both button A and button B at the same time to record a tie, we want to add
1 to the current value of the variable PlayersTie

F I , ‘ ’

L ‘ ’ - ‘B’ ‘ +B’
third block.

F V , ‘ ’

Place one change block into each of the Button Pressed blocks.

Choose the appropriate variable from the pull down menus in the change blocks.

03.Variables Page 49
input.onButtonPressed(Button.A, () => {
PlayerAWins += 1
})
input.onButtonPressed(Button.B, () => {
PlayerBWins += 1
})
input.onButtonPressed(Button.AB, () => {
PlayersTie += 1
})

User feedback
Whenever the scorekeeper presses button A, button B, or both buttons together, we will give the user visual feedback
acknowledging that the user pressed a button. We can do this by coding our program to display:
• ‘ ’ ,
• ‘B’ ‘B’ B,
• ‘ ’ B

W ‘ ’, ‘B’, ‘ ’ ‘ ’ ‘ ’

I , ‘ ’

03.Variables Page 50
input.onButtonPressed(Button.A, () => {
PlayerAWins += 1
basic.showLeds(`
. # # # .
. # . # .
. # # # .
. # . # .
. # . # .
`)
basic.clearScreen()
})
input.onButtonPressed(Button.B, () => {
PlayerBWins += 1
basic.showLeds(`
. # # . .
. # . # .
. # # # .
. # . # .
. # # . .
`)
basic.clearScreen()
})
input.onButtonPressed(Button.AB, () => {
PlayersTie += 1
basic.showLeds(`
. # # # .
. . # . .
. . # . .
. . # . .
. . # . .
`)
basic.clearScreen()
})

03.Variables Page 51
N ‘ ’ ‘ ’, ‘B’, ‘ ’
What do you think would happen if we did not clear the screen? Try it.

Showing the final values of the variables


To finish our program, we can add code that tells the Micro:bit to display the final values of our variables.
B, ‘ ’
W ‘ ’, ‘ ’, ‘ ’, ‘ ’
Here is the complete program.

let PlayersTie = 0
let PlayerBWins = 0
let PlayerAWins = 0
input.onButtonPressed(Button.A, () => {
PlayerAWins += 1
basic.showLeds(`
. # # # .
. # . # .
. # # # .
. # . # .
. # . # .
`)
basic.clearScreen()
})
input.onButtonPressed(Button.B, () => {
PlayerBWins += 1
basic.showLeds(`
. # # . .
. # . # .

03.Variables Page 52
. # . # .
. # # # .
. # . # .
. # # . .
`)
basic.clearScreen()
})
input.onButtonPressed(Button.AB, () => {
PlayersTie += 1
basic.showLeds(`
. # # # .
. . # . .
. . # . .
. . # . .
. . # . .
`)
basic.clearScreen()
})
input.onGesture(Gesture.Shake, () => {
basic.showString("Wins:")
basic.showLeds(`
. # # # .
. # . # .
. # # # .
. # . # .
. # . # .
`)
basic.showNumber(PlayerAWins)
basic.pause(1000)
basic.showLeds(`
. # # . .
. # . # .
. # # # .
. # . # .
. # # . .
`)
basic.showNumber(PlayerBWins)
basic.pause(1000)
basic.showString("Ties:")
basic.showNumber(PlayersTie)
basic.pause(1000)
basic.clearScreen()
})
PlayerAWins = 0
PlayerBWins = 0
PlayersTie = 0

Scorekeeper

03.Variables Page 53
Try it out!
Download the Scorekeeper program to the micro:bit, and have the students play one last round of Rock Paper Scissors
using their micro:bits to act as the Scorekeeper!

‘Adding’ on with mathematical operations


There is more we can do with the input we received using this program. We can use mathematical operations on our
variables.

’ , ‘ ’
this, we can add the values stored in the variables we created to keep track of how many times each player won and
how many times they tied.

In order to do this, we can add the code to our program under the 'on shake' event handler .
• First, display a string to show the player that the following sum represents the total number of rounds played.
• Our program will add the values stored in the variables 'PlayerAWins', 'PlayerBWins', and 'PlayersTie' and then
display the sum of this mathematical operation.
• The blocks for the mathematical operations adding, subtracting, multiplying, and dividing are listed in the Math
section of the Toolbox.
Note: Even though there are 4 blocks shown for these 4 operations, you can access any of the four operations
from any of the four blocks, and you can also access the exponent operation from these blocks.

03.Variables Page 54
• Replace the default values of zero with the names of the variables we want to add together.
Notice that because we are adding three variables together we need a second math block. First we add the
values for 'PlayerAWins' and 'PlayerBWins', then add 'PlayersTie'.

input.onGesture(Gesture.Shake, () => {
basic.showString("Total rounds played:")
basic.showNumber(PlayerAWins + PlayerBWins + PlayersTie)

• Save, download, and try the program again to make sure that it runs correctly and displays the correct numbers
for each variable.

Remember that the micro:bit is a device that processes input and displays it as output in some way. By storing values
in variables, you can perform mathematical operations on that data that provides you with useful information.

What other math operations could provide valuable information from the values stored in these variables?

Examples:

03.Variables Page 55
• ’
• Calculate a display the number of tied games as a percentage of all rounds played.

03.Variables Page 56
Project: Everything Counts

This is an assignment for students to come up with a Micro:bit program that counts something.
Their program should keep track of input by storing values in variables, and provide output in some visual and useful way.
Students should also perform mathematical operations on the variables to give useful output.

Input
Remind the students of all the different inputs available to them through the Micro:bit.

Project Ideas

Duct tape wallet


You can find instructions on the web for creating a durable, fashionable wallet or purse out of duct tape
(https://pxt.microbit.org/projects/wallet). Create a place for the micro:bit to fit securely. Use Button A to add dollars to the wallet, and Button
B to subtract dollars from the wallet.
Extra Mod: Use other inputs to handle cents, and provide a way to display how much money is in the wallet in dollars and cents.


In baseball during an at-bat, umpires must keep track of how many pitches have been thrown to each batter. Use Button A to record the
number of balls (up to 4) and the number of strikes (up to 3).
Extra Mod: Create a way to reset both variables to zero, create a way to see the number of balls and strikes on the screen at the same time.

Shake counter
Using the 'On Shake' block, you can detect when the micro:bit has been shaken and increment a variable accordingly. Try attaching the
micro:bit to a lacrosse stick and keep track of how many times you have successfully thrown the ball up in the air and caught it.
Extra Mod: Make the micro:bit create a sound of increasing pitch every time you successfully catch the ball.

Pedometer
See if you can count your steps while running or doing other physical activities carrying the micro:bit. Where is it best mounted?
D ’

Calculator
Create an adding machine. Use Button A to increment the first number, and Button B to increment the second number. Then, use Shake or
Buttons A + B to add the two numbers and display their sum.
Extra Mod: Find a way to select and perform other math operations.

03.Variables Page 57
Homemade Top with Micro:bit Revolution Counter

Duct Tape Wallet with Micro:bit Display

Baseball Pitch Counter

Process
In any design project, it's important to start by understanding the problem. You can begin this activity by interviewing people around you
who might have encountered the problem you are trying to solve. For example, if you are designing a wallet, ask your friends how they store

03.Variables Page 58
who might have encountered the problem you are trying to solve. For example, if you are designing a wallet, ask your friends how they store
their money, credit cards, identification, etc. What are some challenges with their current system? What do they like about it? What else do
they use their wallets for?

If you are designing something else, think about how you might find out more information about your problem through interviewing or
observing people using current solutions.

Then start brainstorming. Sketch out a variety of different ideas. Remember that it's okay if the ideas seem far-out or impractical. Some of the
best products come out of seemingly crazy ideas that can ultimately be worked into the design of something useful. What kind of holder can
you design to hold the Micro:bit securely? How will it be used in the real world, as part of a physical design?

Use the simulator to do your programming, and test out a number of different ideas. What is the easiest way to keep track of data? If you are
designing for the accelerometer, try to see what different values are generated through different actions (you can display the value the
accelerometer is currently reading using the 'Show Number' block; clear the screen afterward so you can see the reading).

basic.forever(() => {
basic.showNumber(input.acceleration(Dimension.X))
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
`)
})

Reflection
Have students write a reflection of about 150–300 words, addressing the following points:
• What was the problem you were trying to solve with this project?
• What were the Variables that you used to keep track of information?
• What mathematical operations did you perform on your variables? What information did you provide?
• Describe what the physical component of your Micro:bit project was (e.g., an armband, a wallet, a holder, etc.)
• How well did your prototype work? What were you happy with? What would you change?
• What was something that was surprising to you about the process of creating this project?
• Describe a difficult point in the process of designing this project, and explain how you resolved it.

Assessment

4 3 2 1
Variables At least 3 different variables At least 2 variables are At least 1 variable is No variables are
are implemented in a implemented in a meaningful implemented in a meaningful implemented.
meaningful way way way
Variable names All variable names are The majority of variable names A minority of variable names None of the variable
unique and clearly describe are unique and clearly describe are unique and clearly describe names clearly describe
what information values the what information values the what information values the what information values
variables hold. variables hold. variables hold. the variables hold.
Mathematical Uses a mathematical Uses a mathematical operation Uses a mathematical operation No mathematical
operations operation on at least two on at least one variable in a incorrectly or not in a way that operations are used.
variables in a way that is way that is integral to the is integral to the program
integral to the program program
Micro:bit Micro:bit program: Micro:bit program lacks 1 of Micro:bit program lacks 2 of Micro:bit program lacks 3

03.Variables Page 59
Micro:bit Micro:bit program: Micro:bit program lacks 1 of Micro:bit program lacks 2 of Micro:bit program lacks 3
program • Uses variables in a way that the required elements the required elements or more of the required
is integral to the program, elements
• Uses mathematical
operations to add, subtract,
multiply, and/or divide
variables,
• Compiles and runs as
intended,
• Meaningful comments in
code
Collaboration Reflection piece addresses Reflection piece lacks 1 of the Reflection piece lacks 2 of the Reflection piece
reflection all prompts. required elements. required elements. lacks 3 of the required
elements.

03.Variables Page 60
Standards

CSTA K-12 Computer Science Standards

• CL.L2-03 Collaborate with peers, experts, and others using collaborative practices such as
pair programming, working in project teams, and participating in group active learning
activities

• CT.L1:6-01 Understand and use the basic steps in algorithmic problem-solving

• CT.L1:6-02 Develop a simple understanding of an algorithm using computer-free exercises

• CPP.L1:6-05 Construct a program as a set of step-by-step instructions to be acted out

• 2-A-5-7 Create variables that represent different types of data and manipulate their values.

03.Variables Page 61

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy