video

Lesson video

In progress...

Loading...

Hi, I'm Allen a computer teacher for this unit, which is physical computing.

This is lesson four, which is called Making Connection Part Two.

You will need your micro bit again today and a lead to connect it to your computer.

And you'll also need two crocodile clips.

So this lesson you'll also need some speakers or a set of headphones.

That's got these small three and a half mil Jack on the end that looks something like that.

Okay? So the phone notifications that are nearby, remove any distractions and when you're ready, we'll get started.

Okay, in this lesson we're going to use the micro bits built-in input and output devices to produce some sound.

From previous lessons you know that we can use outputs on the LED display to send messages or create images.

But these GPIO pins can also be connected to headphones or speakers.

And like I said in the introduction, you will need some headphones for this lesson If you want to do some of the tasks.

There is an illustration on the right hand side on how to set up your headphones.

So we use crocodile clips again and we connect one of them to pin 0.

And we connect one of them to the ground pin.

Now it doesn't matter which way around they connect to the headphone Jack, as long as you've got that metal portion clear, like you can see in the diagram there.

Okay, so on this one we've got the pin zero all the way built it up to the left and we've got the ground one on the right hand side just before the end.

Okay.

So if you set it up like that, then everything should work just fine.

If you find that it doesn't work, when you're setting it up, it may be the case that you just need to adjust those crocodile clips.

So they not going past the little lines, the boundaries of where each section on that jacket.

Okay.

So you're going to have some code below when, when that code is completed, it allows your micro bit to play some melodies.

Now we are importing the music module here because we do want to make use of some of the features or the functions and melodies that are available to us on the micro bit and quite straightforward.

When we fill in that purple section with a piece of code, then we can play a specific melody.

I'll show you a demonstration of that now.

Okay.

So as always from micro bit import star and everything.

and this time, we're also going to make use of the music module, import music and quite straightforward.

All we're going to do is we're going to say music, play music dot blues.

So this one, okay.

So now when I flash that, you'll be able to see what happens.

Okay.

So I've got my micro bit and I flashed the programme and I can connect one of them to that end and one to that end, Of my my speaker jack or headphones, whatever you got.

And I'm just going to reset my programme by pressing the button on the back.

There you go and you can hear the tune.

That was blues if you're interested.

So there you go.

Okay.

So have you found that useful, you've now got tasks to do, and there's a little piece of code there for you on the worksheet.

There are some additional melodies names of melodies that you could type in.

So what I'd like you to do is pause the video and complete the task.

Okay? I hope you enjoyed that.

It's lots of fun putting those different melodies and the sounds in there and understanding that the micro bit can, you know play tunes is really cool.

I have a challenge for you now.

So what I'm going to challenge you to do is using some of the snippets on the screen that you can see there some of those are from a previous lesson and some are from obviously today's lesson.

What I'd like you to do is see if you can get the micro bit to play a melody.

When one of the pins is touched, Okay? pause the video and give it a go.

Okay.

Did you manage to get that working? Well, I hope you did.

And I've got another challenge for you now, making it a little bit more intricate.

So I'd like you to do a similar kind of challenge.

But this time when you touch one of the pins, not only does it display an image, but that it plays the tune as well.

So you can get two outputs from, from the one input from your pin.

You can pause the video and complete the task.

Okay, I hope you managed to do that.

And if you didn't, there's a slide on the worksheet right to the very end, that's got a coded solution for you to give it a go.

It's only about eight lines of code to get it finished.

Don't forget.

There is a quiz at the end of this lesson to assess your learning, So please complete that.

And I'd love to see any work that you've completed or any tunes that you've made come on or images with your micro bit.

If you'd like to share this, please ask a parent or carer to share your work on Instagram, Facebook, or Twitter, target at national and hashtag live without I'll see you next time.