 Hey, welcome to part two of our telling the time of the five minutes activity If you haven't already go check out part one It's a card in the top right hand corner right now coming your way We'll go start set the link in the description. You'll need that first in this tutorial We'll be putting the finishing touches on our clock as well as using scratch to coat it up So let's go pick it up where we left off All right I've got the makey makey down here and I've remapped all the keys on the back of the makey makey You're not sure what I'm talking about go check the card in the top right corner right now to go check out The other videos that got us to this point You'll also see some cables coming up from the back of the makey makey I'm just going to zoom in to give you a better look All right So these cables connect to the key presses of the back of the makey makey And what we'll do is we will connect the alligator cables to the jumper cables that are attached to the clock And that's how we're going to hook up all the buttons now for my ours makey makey I've remapped the keys on the left side to one two three four five six and the keys on the right side to seven eight nine Zero you and why I've done something a little bit different for the minutes makey makey as well It's totally okay. If you've remapped them differently, you really just need to keep track of where you're at Cool, let's jump over to scratch and code this beast up Over here in scratch I've just got an empty project and I've just gone ahead and googled clock face and just grabbed an image To put on the stage. We won't actually be using this image But I just thought it'd be nice to have the clock face there The first thing I want to do is map each of the keys of the makey makey to a spot on the list What does that mean? Let's go over to the variables category Let's zoom in and create a new list and we're going to call this one minutes Cool You'll see here as I bring up the makey makey that I've mapped all the buttons to various positions So this will be the spot on the clock where the number one is the number two three four five six Seven eight nine ten eleven and this will be o clock in each spot on the list I'm going to put the corresponding letter. So in the first spot of the list, I'll put the letter w So when we hit a w key press, I know that that's mapped to the number one. So over here in scratch I'm just going to put the letter w in this one a s d F g I recommend that you just put them in a nice neat order. Cool. Now. I've got all my 12 spots filled I'm going to do the same thing for the out. So jumping over to making a new list You know hours. I'm going to use the same spots for the hours, but I've changed the different key So I've got one two three four five six seven eight nine zero u and y Over here in scratch. I'm just going to enter that in now. So one's going to mean one two and y So now I've got all these spots of my hours and all the spots of my minutes So let's say for instance, I hit the letter u on the keyboard Then that's going to look up position 11 What I'm going to do now is create a custom block and it's going to be called set minutes So we have set minutes here and what set minutes is going to do It's going to have 12 different if statements to check if the current key is pressed down Cool. So I've got my if statement here if the w key is pressed If we look over here onto the stage, that's where we've got this first spot We want the minutes to be mapped to number one So what we can do is create a variable here. I'm going to call it minutes key Then we can set the minutes key to the item number of the thing we're looking for Well, the thing we're looking for is the letter w So if I type the letter w and I change this to minutes, we should get the number one And we do I change this to k for instance k is number nine. I click this We should get the number nine through exactly what we're after So we'll leave it as w and then we'll set that inside We've got our block of code that accounts for position one We need to repeat this for the rest of them So I'm just going to go through and duplicate these now for each other spot Cool. So I've gone ahead and I've entered in all those values for the minute key I just renamed it to minute key to get rid of the plural there Now if I press keys on the keyboard at the moment, nothing's going to happen Because nothing is currently calling set minutes So we need to change that I'm going to say when the green flag is clicked forever, we want to set minutes So let's click the green flag and now when I press say a on the keyboard We get the number two So this is this would be at the seconds slot here If we type f on the keyboard, we should get the number five Boom and that's how it works We're going to do the same thing for the hours See if you can have a crack at it first All right, so I've gone ahead and created a new function called set hours And instead of setting the minute key, we've got an hour key here So I just created a new variable called our key I just went through and I populated all the values to match what they should be So when we press the one key, we will turn item one of the hours list And so forth The last thing that we need to do is inside of our forever loop We also need to call set hours So let's go test this out I'll hit the number four and then we go Our key is now number four Let's hit the letter Y and it's 12 So all as well Now that we have our keys working, we want to save the time So we're going to use the text to speech extension So click down the extensions in the bottom left hand corner And find the one that says text to speech And we get a few blocks here The first one we're going to drag out is speak block Now if we click this now Hello It says hello We're going to change this to the time is Because remember, our clock wants to tell us what the time We can duplicate this The time is The time is Cool So we want to combine the current hours with the current minutes Well, we've already set the hour and the minute key So our job is pretty simple Let's go over to the operators And drag out a couple of join blocks We're going to put the hour in first Because usually you'll see the hours And then we're going to put in the second join block We're going to put in a space And then we want to put in the minutes But the minute key doesn't refer to the minutes Can you think of a way how we can use this value to mention the minutes? Could you guess it? You can use the multiplication operator Still stuck? Drag in the minute key And all you need to do is multiply it by five Drag it back in And it should work So right now if I click this We'll get the hour, space, and then the minutes time five So 12, 25 And that makes sense because five times five is 25 And 25 minutes would be here on the clock We can get this and drag it inside of our speak blocks And let's listen to it The time is 12, 25 So that's pretty cool The last thing that we need to do is Attaches to a space key press So now when I press the space key It will tell the time The time is 12, 25 Awesome Now there is a minor bug with this If we set the minutes to 60 minutes It's going to tell us that the time is 60 minutes So I'm going to leave that up to you to problem solve that It shouldn't be too difficult for you to do But I just want you to be aware of this current bug The time is 12, 60 Now that we have our scratch project set up It's time to go grab the makey makey And hook up all the alligator cables to the jumper cables And get our clock working All right, so this is where things are going to start to get a little bit funky and crazy So I've got the clock here And remember it goes in anti-clockwise direction We've got 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 All the way back to 12 12's here at the top So we're going to be getting both of our makey makeys So here I've got an hours makey makey Just by signal that by a little poster note And I've also got a minutes makey makey here That I haven't yet plugged in So what we're going to be doing Is we're going to be working probably on the inside first Because that seems the most logical for me And then I'll hook up the minutes around the outside Now here's where I'm hoping that you've gone in And you've tagged your cables So you don't have to try and figure out Which one means which So you can see here with my green cables I know this cable is referring to the first hour I know this cable is referring to the second hour And this one the third And I think this one here is the 12th hour Which is cool So I know that the 12th hour There it is right there Now if I just bring out a little graphic here Of our remapping I know that here are the hours on the left hand side And on the right hand side In all of our slots I can put the making making directly on here I can use this to help me I'll just zoom in here Just so you can get a better look The first jumper cable spot refers to the number one The hours are nice and neat So one maps to one All I need to remember is just getting this red one here Because that's the one that's in the top spot Then what I want to do Is find my alligator cable That has That has the first hour on it So hour one is going to connect to the red cable And all I need to do is connect them like that I'm going to do the same thing for the other cables So the next color in line is this brownie color And I'm just going to separate that out And then connect it up I'm going to do that for all the hours And all the jumper cables While you're doing this It might be a good idea to push up the rubber sleeves Of the alligator cables So that way they don't connect with the other jumpers Cool It's looking a little messy But all the cables are now hooked up I recommend before proceeding You actually jump over to scratch And you make sure that this is working All right, so I've got our clock here set up And what we're going to do now Is that I've connected the hands to the ground As you can see here in the makey makey And as I rotate the hour hand And I think my hour hand is actually a little bit small But if we check out scratch You'll see that the hour key will change So here we go I'm going to move the hour hand This should be the third hour So if I move the hand Boom It is now three hours on scratch If I move it up here We should get two We should be able to get right around I can see my 11 and 12 are back to front I can easily fix that up And let's go right around to test So there's nine, eight, seven, and six So just my 11 and 12 They're around the other way Now I want you to go ahead and do the exact same thing But for all the minute locations So that will be connecting all the alligator cables To the jumper cables of the second makey makey Now that I've got all my hour hand synced up I'm just going to get all the cables So that's the green ones These orange ones here And these white ones for me And I'm just going to group all of them together Got a bit of tape And I'm just going to wrap them all together Just to try and create some order Amongst all this kind of wide chaos here There we go All right, cool So I've gone ahead and I've hooked up All the minutes around the edge as well One thing to note is that You have to connect both makey makeies to the ground You can easily just run one alligator cable From one makey makey To another makey makey's ground Simple Okay, let's bring up the scratch screen And now I'm going to move the minute hand And watch the minutes update on the screen So here we are on 12 Got one, two, three, four, five, six, seven Got a bit of a bug there There's 11, nine, 10, 11 So we just have a bit of a bug over here With our number seven So we'll have to go and inspect that one But largely all as well All right, that bug will squash You just need to make sure That the alligator cable to the jumper cable connections Aren't colliding with each other In other words They could be triggering a different button press If they're touching If we go here and we actually position our hands To where they should be You'll see here That time should be quarter past six The time is six fifteen And it is Now you know With an actual clock That we'd want our hand slightly rotated Ahead of the six But we will skip over that minor detail here If we were to program the clock on scratch We could definitely program that one in The last step in this process And I highly recommend it Is to hide all of your wiring Behind some other cardboard I quite like using pizza boxes But hey You might want to make a class clock And you could use a giant piece of cardboard as well What you need to do is cut out a hole And place your clock into it And there you have it There's all the wiring of the clock that's behind as well Just stuck down with a few bits of tape And it's pretty nice how we've organized These cables already You could definitely make this need it Than I have I'm just showing you this as an idea And there you have it That's how you make a makey makey clock The time is four thirty Hey, thanks for checking out this makey makey project On clocks and telling time to the nearest five minutes Dig in this content and smash that like button And if you're an educator Consider joining the surfing scratcher mailing List linked below in the description There are plenty more projects coming your way But until then I'm off to go find a wave I'll catch you in the next one