Loading...
Hello, everybody.
It's Mrs. Franzsen here.
Welcome to Computing.
It's really good to have you in my lesson today.
Let's get started learning about Physical Computing.
By the end of this lesson, you will be able to control a simple circuit connected to a computer.
Let's look at the keywords for this lesson.
The first keyword is microcontroller.
A microcontroller is a small computer that can be programmed to control output components and respond to inputs.
The next keyword is Crumble.
A Crumble is a microcontroller which can control outputs and respond to inputs.
The next keyword is Sparkle.
A Sparkle is an LED light that can connect to a Crumble.
In the first part of a lesson, you are going to build and test a simple circuit.
Izzy says, "What is a microcontroller?" A microcontroller is a small computer.
It can be programmed to control output components and respond to inputs.
The microcontroller you'll be using is a Crumble controller.
You will programme a Crumble to control outputs and respond to inputs.
This is an example of a Crumble microcontroller being used.
A light called the Sparkle is changing colour.
In the animation, you can see the Sparkle LED light highlighted there, which is flashing.
It is attached to the Crumble microcontroller, which is the device which has the white cable in the animation there.
Look closely at the Crumble controller.
What details do you notice? Pause the video here and have a think about that.
Let's have a look at the Crumble controller and see what details you noticed.
Jacob says, "It has holes with the letters A, B, C, and D." I wonder if you spotted that.
Sam says, "It has four holes with plus symbols.
And it has four holes with minus symbols, too." The holes in the Crumble are the pads.
The pads are the connection points between the Crumble and the components.
Laura says, "It has a micro USB port to connect it to a computer." Well done if you notice that.
Let's do a check here.
What is a microcontroller? Is it A, a small computer that can control outputs.
Is it B, a remote control.
Pr is it C, an LED.
Pause the video here to think about your answer.
Welcome back.
Let's look at the answer for this question.
What is a microcontroller? The answer is, it is A.
A microcontroller is a small computer that can control outputs.
Well done if you got that one right.
This is a Sparkle.
A Sparkle is a multicolor LED light designed to work with the Crumble.
I wonder if you can see some similarities here with the design of the Crumble and how the Sparkle is designed.
A Sparkle needs to be connected to the Crumble with three wires.
Two of the wires provide power to the LED and one is used to control the LED's colour.
You can see in the animation here how the Sparkle LED light lights up.
Looking closely at the Sparkle, you can see that it's got a connection point here, which connects to a positive power pad on the Crumble controller that's marked with A+.
We've also got some pads that connect to a negative power pad on the Crumble controller that's marked with a minus, and we've got a connection point here that connects to the D pad on the Crumble controller.
And then on the right-hand side of the Sparkle, the pads on this side are used to connect to other Sparkles, so if you want to chain them together.
To build a circuit, you need, a battery pack, a Crumble, a Sparkle.
The Crumble connects to the computer using a micro USB cable, which is here.
Use crocodile clips to connect the components as shown.
These are the crocodile clips.
Sam says, "It doesn't matter what colour your wires are." You might have crocodile clip wires that are different colours and that is fine.
Laura says, "The pads need to be connected correctly." So look closely at the positive and negative signs there.
The Sparkles positive power pad needs to be connected to the positive power pad on the Crumble controller.
You can see here that positive pads are marked.
The Sparkles negative power pad needs to be connected to the negative power pad on the Crumble controller.
You can see the negative pads are marked for you here too.
The Sparkles D pad needs to be connected to the D pad on the Crumble controller, and that is marked here on the diagram too.
Let's do a check here.
True or false? The wires that connect components together are called alligator clips.
Pause the video here to think about your answer.
The answer was false.
Why? Crocodile clip wires connect the components together.
Well done if you got that answer correct.
Izzy says, "Remember to switch on the battery pack." So many battery packs will have an on, off switch.
Make sure that yours is switched on.
Right, it's time for you to go hands on with this task.
I want you to connect your Crumble using the guide.
When you've connected it correctly, the Sparkle will flash white six times.
This happens because a programme has already been downloaded onto your Crumble.
Off you go and build, and test out your simple circuit and I will be here when you get back.
Welcome back.
Jacob says, "I use the crocodile clips to connect the battery pack to the Crumble, and the Crumble to the Sparkle." Well done for your hard work on that task.
In the second part of the lesson, you will be writing block-based code to control an LED.
Crumbles are programmed using a block-based programming language similar to Scratch.
Maybe you've seen these kind of block-based programmes before in Scratch or in another programming language.
You can create a programme to control the LED light on the Sparkle.
You can see here in the animation, the Sparkle flashing.
To create a Crumble programme.
Drag the blocks from the side panel to the main coding area.
You can see this happening here in the animation.
You can find different blocks in the sections in the side panel.
We've got the different sections here.
They are labelled basic, input and output, Sparkles, control, variables and operators.
Let's have a look at this Crumble code.
What do you think this programme will do? Pause the video and have a think about that.
Welcome back.
Let's look at this code together.
Sam says, "The code is run from top to bottom." Jacob says, "This code will make the Crumble control the Sparkle." Laura says, "This programme makes the Sparkle flash on, off, on.
There is a 0.
5 second pause between each change." The output blocks control the Sparkle.
They are setting the LED colour to red.
You can see here that we have labelled the output blocks.
The control blocks are used to add a delay of 0.
5 seconds between Sparkle commands.
You can see that we've labelled the control blocks here.
Let's do a check here.
Which block is the control block? Is it A, programme start.
B, set Sparkle to red.
Or C, wait 0.
5 seconds.
Pause the video here to think about your answer.
Welcome back.
Which block is the control block? The correct answer was C.
The wait 0.
5 seconds block was the control block.
Well done if you got that right.
You can set the Sparkle to a different colour.
This section here is how you change the colour in the output blocks.
Watch the animation to see how to change the colour in the output blocks.
So you tap on the section, open the colour menu, press on Okay, and it will change the colour for you.
You can change the delay between flashes.
This section is how you change the value in the control blocks.
Watch the animation to see how to change the wait command.
You click on the section, you type in your new number, and you press on the Enter key.
You can change how many times the Sparkle flashes, and you can do this by repeating the pattern of blocks.
The longer that you make your section of code, the more times the Sparkle will flash.
Let's do a check here.
Why is this code not working? Look closely at this Crumble code.
Is it A, because it's not connected to a start block.
Is it B, because the code is too short.
Or is it C, there is no ending block.
Pause the video here and have a think about your answer.
Welcome back.
Why is this code not working? The answer is A, it is not connected to a start block.
Well done if you got that one right.
The play button will send the programme to the Crumble and run it.
The play button is the green triangle.
The programme will remain in the Crumble's memory even when disconnected from the computer.
It is connected at the moment with the micro-USB cable.
Okay, are you ready for your next task? In this task, I want you to programme your Crumble to make the Sparkle flash in different ways.
Record your progress using the table.
Okay, so our table has got a range of colours in the Sparkle flashes column.
Then it has how many times I want you to make the colour flash, and then the third column lists how long that the Sparkle should stay on, or stay off, so the lengths of times in seconds.
And when you have done that section, you put a big tick in the done column, okay.
It's time to go off and programme and make your Crumble flash different colours, and when you are finished, you can come back to the video and we can reflect on the lesson.
Welcome back.
Well done on all of your hard work during that task.
You have learned so much today.
Let's go through our summary of connecting physical computing devices.
The Crumble is a microcontroller.
It can be programmed to control components that are connected to it.
Crocodile clips are used to connect a battery pack and the Sparkle LED to the Crumble.
It's important that the components are connected in the right places.
You can create a programme to control the Sparkle.
By adjusting the code, you can change the colour of the LED, the wait time between flashes, and how long the programme runs for.
You have worked really hard in this lesson today.
Thank you for your effort and I hope to see you again soon.