# data[].attributes.body
***This is a 3 day unit!***

For this final unit you will work to create an interactive project that incorporates the concepts you have learned over the course of the program. Part of the process of creating the project includes time to get feedback from your peers and use that feedback to make changes to your project.

Here’s how:
1.Program Review

Reflect. What do you already know? Reflect on all the things you have learned during our time. Think about the programming concepts you’ve learned and the hardware you’ve learned to use. 🤬 back through your design journal if you can’t remember what we’ve worked on.
2.Discuss.
As a group we will create a list of everything we have learned through

the program. A good refresher!
3.Project Planning
--> The challenge. You will be working to create an interactive project that serves a purpose or fills a need. The project must include:

At least 1 micro:bit

At least 1 micro:bit sensor (light, accelerometer)

At least 1 external input or output (motor, speaker, button, switch, etc.)

Components that are built (cardboard, fabric, or other material)

4.Brainstorm.
Individually and as a group we will brainstorm some ideas to get our creative juices flowing

Hint. If you are struggling to come up with an idea look through their design journals. Let's talk about some of your favorite projects. Could you build on those projects to create something new?

5. Plan and Prototype.
Write down your ideas in your journals as we are brainstorming and then begin narrowing them down.

You might find it helpful to sketch a picture of what your project could look like, labeling the parts.

Additionally you could make a list of inputs and outputs, what they’ll be used for and how they will communicate to the user.

6. Share.
Let's bring the whole group together and each report on the following questions as you've talk in smaller groups.

Describe the project you are creating.

What is something you’re going to have to figure out?

7. Build.
This time is open time for you to work on your project.

Some things to keep in mind:

Pseudocode

Prototype

Check In Times

8.Project Feedback.
Once the you have made good progress with your project it’s a good time for you to get peer feedback.

Please spend 10 minutes reviewing each project and critiquing the project draft using the positive peer review protocol:

Tell something you like.

Ask a question.

Give a suggestion.

When the review is complete, each of you will have received feedback on your project from the other members and can begin making corrections/additions or finalizing touches!

9. Build.
After getting feedback from peers its time to finalize your project.
Remember to ask for help from others and to use your journal for programming help.
10. Discuss.
Once you are almost at the end of your build time we will come together as a group to talk about what you will need to prepare for sharing your project

with others.

You should be prepared to share how you came up with your ideas and something you are proud of.

You should create a label for your project that includes the title, your name, and features people should know about.

11. Share.
Each person should present their project to the whole group through screen sharing on zoom!
12. Celebrate!
You all are rockstars and deserve to celebrate your accomplishments!

# data[].attributes.body
Ever wondered how scientists track animals to study?

To study marine wildlife like spotted eagle rays, researchers attach acoustic tags to the animals. These tags emit a unique sound (or ‘ping’) that can be recorded by receivers placed where the animals travel. Scientists can then use the recorded data to study the habits of individual animals!

-->Watch High Tech Tide! This video will be a good resource for the next challenge!

# data[].attributes.body
You will learn how to adjust the signal strength of the bluetooth antenna.

What are the benefits of being able to send messages from far away? Are there any times when you would only want to send signals when someone is close? (In the High Tech Tide episode they only wanted to count animals that are close to the receiver to make sure the data is accurate.)

1. Discussion. The micro:bit can only send strings (letters) or numbers so youth need to create a code so that they can send other things like emojis, pictures, or sounds.
2. Brainstorm. As a group create the pseudocode for this program.

Person 1 – push a button to send a number.

Person 2 – when a number is received show an icon.

Each pair will need to come up with a code that they agree on with icons that match with the number 1, 2, and 3.

Assign each pair a group number.

3. Program. Create your own program following the directions on the task card.

You will be using conditionals (if/else statements) in this program. If you get stuck take a look in the Logic drawer.

4. Test. Download the program onto micro:bit and test it out.

Food 4 Thought!
How could you change the program so you could send more messages?

Send message using the accelerometer

Use external buttons

Connect a speaker to make a sound

5. Build. Once you have tested your program and are happy with how it is working you can create your wristband using duct tape and various other materials!

# data[].attributes.body
You will write a program using the radio blocks to answer simple yes or no questions asked by a sibling, parent, or friend!

Helpful Tips:

Radio set group (this block allows you to set a group). Ask youth what they think would happen if everyone uses the same group.

Radio send string – allows you to type a message to send

On radio received (receivedString)– tells the micro:bit what to do when it receives a string. “receivedString” is a variable that the program creates for you when you use that block so you just need to drag it into the oval in the “show string” block.

When you use radio blocks a second micro:bit shows up in the emulator so they can test their code.

Extension: Can you create a third option... a yes, a no, a maybe??

# data[].attributes.body
This functionality allows individual micro:bits to send and receive number and string (letters) data.

The micro:bit has Bluetooth radio to communicate (you can see the antenna in the top left corner).

# data[].attributes.attachment_link.title
Behind the MakeCode Hardware - Radio in micro:bit

# data[].attributes.body
Code an Inchworm. You will work to program a simple inch worm

Helpful Tricks:
There are existing Servo blocks in MakeCode, but we have to enable them.

Under ‘Advanced’, click on extensions. Click on Servo. This will add all of the Servo blocks to your tray in MakeCode.

Note that this will need to be done anytime you start a new program that uses servos.

Code your servo to move to 0 when button A is pressed, and 180 when B is pressed.

Never be afraid to modify your code and/or design! Try a range of angles for the motor movement. Try different placement of paperclips or different size cardboard. Testing on carpet vs. Smooth tables can also make a big

difference!

# data[].attributes.attachment_link.description
A inchworm-like robot built with the micro:bit

# data[].attributes.body
Servos are a type of motors that have a built-in sensor that allows for control of the angle that the rotor turns. They have many uses in robotics, manufacturing, and other technical industries.

WATCH!

# data[].attributes.attachment_link.title
Behind the MakeCode Hardware - Servo Motors with micro:bit

# data[].attributes.body
Reminder: input and output options in the micro:bit.

Inputs: buttons, light sensor, accelerometer

Outputs: LEDs, sound

Examples of when we’ve created a program that uses an input to

create an output?

pushing a button to display an LED

Pushing a button to make a sound

Light sensor value to turn light on

Accelerometer values to display icons

What other combinations could we program? What haven’t we tried?

Light sensor to affect sound

Accelerometer to affect sound, etc

We are going to make an instrument using our micro:bit! What are the parts of music that we are interested in?

Tone: the note that is playing

Tempo: the speed of the music

We can use the inputs to do more than just output a note(or series of notes)at a certain beat—we can use the inputs to modify the tone and tempo! For example, we can use the light sensor to make the tempo of the output sound go faster or slower depending on light level!
1. Program your

# data[].attributes.body
You will work to make an instrument using inputs and outputs with the micro:bit.

1. Program your micro:bit so you can increase or decrease the tempo of the sound by pushing the buttons.
New blocks:

PlayTone – this block plays a tone through pin0

ChangeTempoBy – this block changes the tempo by a certain amount of beats per minute (BPM).

Hint. To decrease the bpm use negative numbers

SetTempo – this block sets the tempo to a certain amount

Extension:
Modify your code to change the tone using the accelerometer or light sensor.

Hint. If testing light level by moving a hand in front of the sensor, you have to move slowly to be able to hear the difference in tone.

Hint: Math modifiers are needed to account for differences in the scale of different datasets.

Light level values range from 0to255

Acceleration values can be positive or negative

Tone values for preset notes range from 131 to 988

Build!

Create an instrument (like a piano or a guitar)that can be played using buttons, the accelerometer or the light sensor.

You should create a prototype drawing and write out pseudocode in your journal before starting.

Don't forget to create your program and test it out on the micro:bit before building anything in cardboard.

Hint. There are some tutorials for creating a keyboard or guitar with the micro:bit in MakeCode but the code in them is a little more advanced.

# data[].attributes.body
The 25 LEDs on the micro:bit are normally used as an output (they turn on and off depending on what the code tells them to do). They can also be configured as an input, where they function as a light sensor that can detect the level of ambient light.

Todays Challenges:
1. Make a light meter. LEDs can be used to get a value for the light level of a room (meaning that our micro:bit has a light sensor!). We can use this light sensor to make a night light where the light only turns on when the room is dark. The first step of making a night light is to learn what the light sensor values are, so we will create a simple program that reads the light level. Then go around the house taking notes on the light values in your journal - notes will be helpful!
2. Make a night light. You will make a night light where the LED lights turn on when it is dark.

Things To Think About:

What light level should be used?

Extension: modify the code so the brightness of the LEDs can be changed when buttons are pressed. This can be accomplished by adding more code to your existing night light code. There are many right ways to do this!

Food 4 Thought!
What else could you use the light sensor for? Some smart phones have them, night lights, emergency lights, outdoor lights, some holiday decorations have them). The light level is an input and can be used to trigger any output.

# data[].attributes.body
Definition:

Conditions are basic “if, then” logic statements that modify how code is executed. Conditions are a key part of the decision-making process for computers.

Example:

Conditional statements are part of our everyday lives. As people, we can think about situations and make decisions based on what we observe or know to be true. For example, “If it is raining out, then we will have recess inside.” Or “If it is my birthday, then I can have a birthday cake.” Conditions are cause and effect: “If this, then that."

Programming Application:

Since computers are machines that can’t do anything without us directing them, we direct the computer using conditional statements. This tells the computer what to do and when to do it. In programming, a great example of a condition is a password. Passwords are “if, then” logic statements: If a user enters the correct password, then they can access the program.

WATCH!

# data[].attributes.attachment_link.title
Coding: Conditionals - Coding for Kids - Computer Programming Terms - Flocabulary

# data[].attributes.attachment_link.description
Learn about a basic coding concept, conditional statements, with Flocabulary's educational hip-hop song and activity.

# data[].attributes.body
Conditionals are used when you want the computer (micro:bit) to decide something for you. For example: If I press button A an image of a heart will appear but when I press button B an image of a smile will appear.

1. Challenge. Work to program your micro:bit to display something on the LED triggered by more than one input from the accelerometer.

Hint: You will be able to do this using conditional statements.

2. Display on shake, then change to a different image after 2seconds
3. Use the ‘tilt’ option for the accelerometer to display 3 different images.

Extra!
Once you feel comfortable with conditionals you can upgrade your ROCK.PAPER.SCISSORS game into a game of chance by letting the micro:bit choose the option for you!

Hint: use the random number generator which is an easy way for the micro:bit to pick a random number for you!

# data[].attributes.body
An accelerometer is a sensor that measures movement in three directions. Most smartphones and tablets use an accelerometer to detect motion
WATCH!

# data[].attributes.attachment_link.title
Behind the MakeCode Hardware - Accelerometer on micro:bit

# data[].attributes.body
1. Pseudocode
2. Introduce Micro:Bit and programming with MakeCode

*Animation

*Rock.Paper.Scissors

*Buttons

*Pins

*Inputs v. Outputs

3. Exploring Sensors

*Accelerometer

*Conditional Statements

*Light

*Musical Instrument

4. Adding Motors

*Servo Motors

Inchworm

5. Radio

*Radio Components

*Signal Wristbands

6. Final Project

# data[].attributes.body
What is a sensor? What sensors does a micro:bit have?

Sensors are electronic components that measure things like light, sound, movement, temperature. Sensors are inputs.

Each micro:bit has an accelerometer, a light sensor, a temperature sensor, and a magnetometer (compass)

Todays Challenge:
Work to program their micro:bit to display something on

the LED triggered by shaking and/or tilting the micro:bit.

# data[].attributes.body
You will learn to make a simple game of rock, paper, scissors, by pushing buttons.
Some things to think about!

What are the main parts of the game?

How could you use the micro:bit (the micro:bit will display the rock, the paper, or the scissors, depending on what the player tells the micro:bit to do.

1. Write! pseudocode for the game. For example:

When button A is pressed, display Rock

When button B is pressed, display Paper

When A and B are pressed at the same time, display Scissors

2. Program! Write your Rock, Paper, Scissors code. You can choose a pre-made icon for each option or create your own.

3. Play! Have a Rock Paper Scissors tournament!

# data[].attributes.body
You will work to make a simple alarm that makes a sound when an intruder steps on a doormat.
--> Brainstorm what you will need to make this project first! For example:

Micro:bit, Speaker (or other way to make noise),

Switch material (sponge, foam, or button),

Conductive material (alligator clips, copper tape, or metal paper clips),

Door mat (or piece of construction paper, cardboard, or fabric)

**Engineers always begin with prototypes:a mockup of their project that uses parts that are easy to change or modify if something doesn’t work on the first try.
--> Before building you should sketch out the design so you know how your switch should work.

# data[].attributes.body
Women and girls can do whatever they want. There is no limit to what we as women can accomplish!

# data[].attributes.body
You will learn how to add on additional inputs and outputs like buttons and speakers by using the pins on the bottom of the micro:bit.

There are 5 big pins (external connections are called pins) on the bottom edge of the micro:bit with holes cut out so it is easy to connect wires or alligator clips to them. Notice that the area of the pin is metal, so you can connect anything conductive to it (like alligator clips, copper tape, or wire).

Each of the thin gold stripes at the bottom of the micro:bit is actually a pin that can be programmed, but they are too small for using alligator clips (later in this program we will use a breakout board, called a gator:bit, that lets us access more of the 25 of the pins)

Pins 0, 1, 2 are used to send and receive inputs and outputs.

3V: This pin outputs 3 volts of power and is used when the item being added needs power (3V = 3 volts)

GND: This pin attaches to ground and is necessary to complete an electric circuit (required any time you are using the 3V pin)

Watch out! The pins labelled 3V and GND relate to the power supply of the board, and they should NEVER be connected to each other.

Todays Challenge:
Let's build an attach an external button!

1. Connect an alligator clip to one lead on the button, and the other end of the clip to pin 1.

2. Connect another alligator clip to the lead on the same side of the button, and the other end of the alligator clip to GND.

Hint: Make sure youth connect to button leads on the same side of the button (but it will also work if they use leads that are diagonal from each other).

# data[].attributes.body
The micro:bit has two buttons (labeled A and B), and we can also use wires to attach additional buttons. Is a button an input or an output? Buttons are inputs: we can use a button (an input) to display an output (like a sound, or LED image)

Program: Write a simple program so that when button A is pressed, an image appears on the LEDs. Distribute the Button Coding Task Cards

Hint: buttons are inputs, so look at the purple Input drawer!

Challenge: Modify your program so that one image appears when you press button A, and a different image appears when you push button B.

WATCH!

# data[].attributes.attachment_link.title
Behind the MakeCode Hardware - Buttons on micro:bit

# data[].attributes.body
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

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

# data[].attributes.body
Each student can create their own animation. Draw your own animation in flipbook form by coloring in the LED array on the flipbook Animation Template

# data[].attributes.body
Computer programmers often start projects by using everyday language to write out what they want to happen in their code--this is called pseudocode. This helps you understand the general structure of the program before getting stuck in the details of a language.

Todays Challenge:
Think about something you would like to teach or have taught someone
- Ex: making a pb&j, hugging, folding clothes, eating an apple

1. Write pseudocode for a movement that another student will be able to understand, recreate, and recognize. Then post that code to our site to be tried out by others!