Loading...
Hello everyone.
My name is Mrs. Jenkins.
I can't wait to learn with you today.
Welcome to today's lesson, which is taken from the unit sensing movement with physical computing.
Today's lesson is called the micro:bit, And by the end of today's lesson, you'll be able to create a programme to run on a controllable device.
Before we get started, we have three keywords.
It's really important that we know what these words mean before we go through the lesson, as they will appear all the way through the lesson.
The words are micro:bit, transfer and emulator.
Micro:bit is a small computer that runs simple programmes.
Transfer is to move a programme from one place to another, and emulator is a tool that allows a computer to act like a different kind of computer.
Keep an eye out for those words throughout the lesson.
So those words were micro:bit, transfer and emulator.
In today's lesson, the micro:bit.
We have three learning cycles.
Identify features of a controllable device.
Use an emulator to test a simple programme.
And transfer a programme to the micro:bit.
Let's get started with identify features of a controllable device.
Computers are useful devices because you can use different programmes to perform different tasks.
So we have a personal computer, smartphone, and tablet.
All of these are examples of computers.
The micro:bit is a tiny computer that can run a single programme at a time for a specific purpose.
You can write programmes for the micro:bit on your computer and then transfer them to the micro:bit using a USB cable.
Okay, little check here.
What is a micro:bit? A, an aeroplane, B, a tiny computer or, C, a tablet.
Have a go.
How did you get on? I asked you what is a micro:bit.
A, an aeroplane B, a tiny computer or C, a tablet.
And a micro:bit is B, a tiny computer.
Sam says the micro:bit looks like it has lots of parts on it.
And Jacob says, yes.
The various parts are used for different reasons.
There are buttons for input.
These detect when they are pressed to make things happen.
There is an LED display for output.
These show pictures, words and numbers.
There are GPIO pins for both input and output.
These connect headphones, sense touch and add other electronics so they can be used by the micro bit.
There is a light sensor for input.
This measures how much light is falling on the micro:bit.
There is a radio for communication input and output.
This communicates with micro:bits and other devices without the cable.
There is a compass for input.
This finds magnetic north or measures the strength of magnetic fields.
True or false? The compass finds magnetic north.
Have a go.
How did you get on? I asked you true or false.
The compass finds magnetic north.
The answer is true.
The compass finds magnetic north.
There is a temperature sensor for input.
This measures how warm the surroundings are.
There's an accelerometer for input.
This detects gestures and measures movement.
Okay, we're going to move onto task A now.
I would like you to find the following key features that will be used.
So we are going to look for A and B buttons, LED, display, accelerometer and compass and a USB port to connect to a computer.
Have a go.
How did you get on? I asked you for task A to find the following key features that we are going to be using.
The A and B buttons, the LED display, the accelerometer and compass, the USB port to connect that connects to a computer.
So here we have our A and B buttons, our LED display, the accelerometer and compass and the USB port to connect to a computer.
Great job everyone.
We're going to move on to our second learning cycle now.
Use an emulator to test a simple programme.
Izzy says, I want to start to programme the micro:bit and use some of the hardware on it.
And Jacob explains, you will need to write a programme using the micro:bit MakeCode emulator.
The micro:bit emulator is a tool that enables you to run a programme and see how it will work and the same way as it would on a physical micro:bit.
Micro bit programmes are used using MakeCode.
You can find MakeCode using the oak.
link/makecode.
You have your programming blocks.
This is where you choose your blocks.
This is very similar to other block code you might have come across.
This is your programming area.
This is where the blocks are placed so they can be dragged across and placed.
And this bit is the emulator, a physical, a simulation of a physical micro:bit where you can test your code.
So you can programme something in and try it out on the emulator and see what happens.
Let's have a little check in now.
Which part of the screen do you add blocks to? A, programming blocks.
B, emulator or C programming area.
Have a go.
How did you get on? I asked you which part of the screen do you add blocks to? A, programming blocks, B, emulator, or C, programming area.
The answer is C.
The programming area is the part of the screen you add blocks to.
Great job.
The programme blocks are arranging categories, which makes it easier to find things.
To use blocks you can drag them from the menu and drop them into the programming area.
They can be connected together in the same way as other block coding platforms. Izzy says, using the emulator reminds me of some of the other programming we have done.
And Jacob replies, yes, it is block coding similar to scratch.
There are some differences though.
When testing out a programme on the emulator, code needs to be created in the programming area.
The first bit of code will be from the basic blocks and will display an image on the LEDs.
The code will need to be in placed inside the "on start" block.
I use the show LEDs block and nothing appears.
What did I do wrong? Good question, Izzy.
When using the show LED block, remember until different LEDs are clicked on, there will be nothing to show.
By clicking on a selection of LEDs when the programme is run, it'll show the LEDs selected.
So here you can see the code said, on start show LEDs.
And the LEDs have been clicked on in a pattern.
And if you look over to the other side where the emulator is, you can see it displaying the same pattern with the LEDs.
So I can see my code has now worked.
Okay, a little check in here.
True or false? If you select the show LEDs block and click on a selection of LEDs, the LEDs will show.
Have a go.
How did you get on? I asked you true or false? If you select the show LEDs blocks and click on a selection of LEDs, the LEDs will show.
The answer is true.
It will show the LEDs that have been clicked on.
Just like the physical micro:bit, the buttons on the emulator work when they are pressed.
So here we have a code that says forever.
If button A is pressed, then show and put across.
And then it says, if button B is pressed, then show, and there is a tick.
Moving on to task B, I would like you to have a go at running this code on oak.
link/makecode.
Okay, so we've got forever.
If button A is pressed, then show a cross.
And if button B is pressed, then show a tick.
Have a go.
How did you get on? I asked you to have a go at running this code.
Forever.
If button A is pressed, show cross.
If button B is pressed, show tick.
Hopefully you will have seen it work.
Now I have some questions for you based on those, on that code.
So how many times will the programme check for an input? What icon will be shown if button A is pressed? What icon will be shown if button B is pressed? Have a go.
How did you get on? I asked you to answer the following questions.
How many times will the programme check for an input? What icon will be shown if button A is pressed? And what icon will be shown if button B is pressed? So the programme will check for an input forever because we've got a forever loop around our code.
What icon will be shown if button A is pressed and a cross will be shown? What icon will be shown if button B is pressed? A tick will be shown.
Great job everyone.
Okay, we're going to move into our third line learning cycle today, which is transfer a programme to the micro:bit.
Your programme can be copied onto a micro:bit using a USB lead.
It can then be run on the micro:bit.
Your programme will remain stored on the micro:bit until another programme is downloaded onto it.
The emulator helps us to see how the programme will run on the micro bit.
The programme can also be run on the physical micro:bit.
A little check-in there here for you.
What gets stored on the micro:bit? A, emulator, B programme, C, USB lead or D button.
Have a go.
How did you get on? I asked you what gets stored on the micro:bit? A, emulator, B programme, C, USB lead or D, a button.
The answer is B, a programme.
A programme gets stored on the micro:bit.
Just like the physical micro:bit.
The buttons on the emulator work when they're pressed.
If the algorithm says when button A is pressed and you press button A, the code will run.
Once the programme is on the micro:bit, the code will run once a button is pressed.
Here are the buttons that are for input.
These detect when they are being pressed to make things happen.
Okay, I've got another check for you.
True or false? The buttons on the emulator do not work and just for decoration.
Have a go.
How did you get on? I asked you true or false? The buttons on the emulator do not work and are just for decoration.
The answer is false.
The buttons on the emulator work the same as the physical micro:bit.
Great job everyone.
Izzy says, how can I see my code run on an actual device? There are some steps you can take to run the code on a micro bit.
First you're going to connect the micro:bit to your computer using the USB cable.
Then you will click on download and then locate the file in your downloads folder.
Copy the file from the folder to the micro:bit drive and run the programme on your micro:bit.
So for task C.
I would firstly like to download your programme onto the micro:bit.
Have a look at it and see what it does.
Then you're going to change what each button does in your programme and download it again onto your micro:bit.
Have a go.
How did you get on? I firstly asked you to download your programme onto the micro:bit and explore what it does.
Then I asked you to change what each button does in your programme and then try downloading it again onto your micro:bit.
Izzy says, I was able to change the different icons that appeared when the button was pressed.
Jacob says, I was able to show the word hello on mine.
Great job both of you.
You have worked really well today.
Great job.
Let's summarise our learning.
The micro:bit is a tiny computer that can run a single programme at a time for a specific purpose.
The micro:bit emulator is a tool that enables you to run a programme and see how it will work in the same way as it would on a physical micro:bit.
Your programme can be copied onto a micro:bit using a USB lead.
It can then be run in the micro:bit.
Your programme will remain stored on the micro:bit until another programme is downloaded onto it.
Great job everyone.
I hope to learn with you again soon.