 Hello world, welcome to part two of our masterm activity on how to build a paper plate clock project using scratch and makey makey. If you haven't checked out part one yet, then go start us out the card in the top-hand corner right now. I'll share with you the materials that you need and show you how to build the clock using scratch and makey makey. If you've already seen that video, then let's pick up where we left off, or we're going to refactor some of our code. So let's get stuck into it. Rather than using all these key press hat blocks, we're going to be using some if blocks, and we're going to check to see if the right arrow is down. That's located in the sensing box, so drag out the is the key pressed. I'm going to get the right arrow to reflect this one. So if the right arrow is pressed, then we want to play the quarter-fast sound. To work out half-fast, we're going to get another if block, but we don't just want if the down arrow is pressed. We want if the right arrow and the down arrow is pressed. So we need an and block. So I'm going to get that and block there. I'm going to duplicate our key right arrow press, and I'm going to duplicate that again, and change it to down to reflect this one. So then I can drag in half-fast. Can you spot the pattern here? Do you know what's going to happen next? You're going to need another and block. We'll duplicate one of these key press blocks, and let's make the left arrow in there. Then we want to take this whole block and duplicate it and stick it inside this and block. Drag out another if block and put that whole condition inside that if statement, connect it up, and that's when we are quarter-two. Let's just zoom out there, see what's going on. You can see it's getting longer each time because we want all those arrows to be pressed at the same time. We'll do the same thing for the o-clock, and that just means that all four buttons are pressed down at the same time. Grab out another and block, duplicate one of those sensing blocks, set it to up arrow to reflect this play sound, and then duplicate that whole condition. Grab out another if statement, and then drag in the condition into that if statement. Finally, put the play block inside. Cool. So now we've got all of our code, and that's fine, but it's still not going to work. And what I suggest that we do is activate this on a space press. So when the space key is pressed, then we'll find out if it's quarter-fast, half-fast, quarter-two, or o-clock. Let's test out to see if this works. Okay, so we've got the clock back here in action, and we've got the scratch project up and running as well. So what we'll go ahead and do is we'll just turn over the quarter-fast segment, and we'll let it play. And notice it doesn't play, but here in the makey-makey, you might see the little light illuminated for the right arrow press, and that's good news. So then if we press the space bar, we should get the quarter-fast sound. It's quarter-fast, and we do. So that's awesome. Now let's turn over the half-fast. Cool, you'll see I've got two lights illuminated here on the makey-makey. It might be a little bit hard for you to see, but if I press the space bar now, we should get half-fast. It's quarter-fast. It's half-fast. So we noticed a little bug there, and it played the quarter-fast and the half-fast. So we don't want that to happen, so we'll have to go in and fix it. Cool, and I just noticed I've got some duplicate code here as well. So the first thing we'll do is go ahead and delete that. So the way that we're going to work around this bug is we need to work in the reverse order that we're working at the moment. And we're going to be using some if-then-else blocks. What we're going to do is we're going to check to see if all these arrows are down, because this is the least likely condition, because you'll see here that the right arrow appears in every single condition. So we want to get the condition that is least likely first. So I'm going to drag that condition and go, if it's o'clock, then we want to play o'clock, which is cool. Then we want to drag out another if-then-else statement. It's going to drag all this down to give us some room. And we want to get the condition where all those three buttons are pressed. And we'll grab that condition and put it inside the next if-then-else block. Put it in the next if-then-else block. Drag out the play quarter two and all as well. Same deal. Grab out an if-then-else block and you want to get the half-pass condition and then drag in the half-pass sound. Lastly, we don't need an if-then-else block for the last one, because there is no else condition here. So we can just put that block inside. So what this is saying is if all these four arrow keys are pressed down, then we want to play the o'clock. But if not all four, then let's go check out this other business. Then the first thing that we check to see is if these three arrow keys are pressed down. If so, then it's quarter two. But if not, we want to go check out some more business. And then we get to check to see if the down arrow and the right arrow key is pressed. If so, we'll play half-pass. Otherwise, check for some more conditions. And the last condition that we'll check for is if the key right arrow is pressed and then we'll play quarter-passed. Let's see if that works. Okay. The other thing I did was just put the when the space key is pressed half block back in. All right. So I'm just over here with the makey-makey. I'm going to start turning over the segments again. Cool. So we'll press space bar. It's quarter-passed. And it's quarter-passed. Let's turn over the segment for half-pass. Okay. I've got my two lights illuminated on the makey-makey space bar. It's half-passed. And it's half-passed. Let's turn over the quarter-two segment. The quarter-two segment is now turned over. I've got three lights in the makey-makey. Hopefully it's quarter-two. It's quarter-two. And it is quarter-two. The last segment is the o-clock. So I'm going to turn that over. And let's see. All four lights illuminated on the makey-makey. Press the space bar. It's o-clock. And it's o-clock. Wonderful. All is working as it should be. Just be mindful that if you're using the arrow keys on the makey-makey, just be working in scratch and scratch only. As it'll be impossible to navigate any other program if all these arrow keys are being pressed. The last thing I've gone ahead and done over here is just put on a little hour hand. And this one isn't going to speak to us. But when you're working with your group of learners, you might be able to use this hour hand to consolidate are we quarter-passed? Are we quarter-two? What are we to? I've got a card in the top corner that's going to show you another clock that is a little bit more advanced than this one that will also tell minutes and hours. But you could use this hour hand with your group of learners just as you would with any other paper clock to get them to say what the time is. Hey, thanks for checking out this Math STEM activity on how to build a basic paper play clock project using scratch and makey-makey. If you found some value, then smash that like button. And if you're looking for something a little more challenging, I'll have a version for you on your screen shortly that uses two makey-makeys and tells time for both minutes and hours. Educators, I'll also have available soon some resources that you can use with your group of learners in your classroom. Check the description for more information. But until then, I'm off to go find a wave. I'll catch you in the next one.