Streamed live 12 July, 4:45 pm AEST
Click to toggle workshop transcript
Good morning, and thanks for once again choosing to tune in to the EduKits Interactive Coding Experience. Or, if you’re watching this stream as a recording, thanks for hitting the play button on this video. I’m thrilled to have you with us again today.
We’re going to be building two new inventions with the Amazing Annoyatron, but before I get into what those are and what they do, I’d like to mention a few things that I bring up at the start of each one of these sessions.
Firstly, we are going to be having a Q&A session at the end of today’s stream. You can participate in this by sending us an email with your questions or comments to the email address which is appearing on the screen now. And you can also find this email address in the sidebar of the stream page, which you’re using to watch this stream now. The email address is [email protected].
Of course, as I say every time, if you are watching this as a recording, we’d still love to follow up with you with your questions and comments. It just won’t happen over this live stream, obviously, and we’ll be doing that over email. So feel free to email us at any time throughout this stream or afterwards with anything about the things we’re doing in this video, and also just anything with the Annoyatron in general. We love hearing back from our users.
So now let’s take a look at what we’re going to be doing today, because I’m very excited. These are two of my favorite inventions with the Annoyatron and you’ll see why, I think, once we get to building them.
So in this workshop, the first invention we have is the decision maker. This is essentially like a fortune telling robot in that you type in a question into the decision maker and it gives you a yes/no answer. So you can type in something like “Will it rain today?” or “Should I pack a Vegemite sandwich in my backpack today?” and it will tell you whether or not you should do that. Of course, We will go over exactly how this works and why it isn’t really a fortune telling machine in just a moment.
But before that, let’s look at the second invention, which is the Wacky Word Wizard. This is tremendous fun. This is an absolute riot. It’s amazing. It generates ridiculous, random, hilarious sentences which generally make no sense, and the best part will come when we customise those sentences to make them really our own.
So without further ado, let’s get started on finding all the parts we need to build these inventions, which really, there aren’t many of them, and then getting straight to the coding part, because there’s some cool things we’ll be doing today. So firstly, the parts. And this week, it’s pretty simple. All you need is your Brain Board, you need the USB cable required to connect it to your computer. Make sure that you disconnect the other parts, especially if you’ve got a buzzer. You won’t be needing that today. You won’t be needing a button, an LED, and removing the buzzer makes sure there’s no annoying noises going on while we’re preparing the code for this first invention.
So I’m going to connect this to power just so it’s ready to go. I’ve connected it to my computer and I now have the lights on the board which tell me it is on and ready to go.
Now it’s time to jump onto the computer and load up the EduKits website. On the EduKits website, head to the product section and under the Amazing Annoyatron, click on inventions. This is going to take us to the page where it lists all the Annoyatron inventions so that we can see the instructions and more importantly find some sample code.
If we scroll down you can see the picture of the brain in the top hat and that is our decision maker. Let’s click on that and you’ll see that the instructions load up on the screen. The part we’re interested in is the sample code and I’ll scroll down to this here. Okay, before you get to go and copy and paste it, let’s take a look at what this invention does exactly and how it works, because it’s pretty interesting.
So the decision maker, it helps you make decisions. You type in a question and it… so something like “Should I bake a cake today?” There you go, that’s the question. And it’s going to tell you either “Yes, you should” or “No, you shouldn’t”. And you don’t actually know which one of these it’s going to be before you type in your answer. It’s not following a specific pattern is completely random, but the people you’re testing it on don’t have to know that. You can tell them it’s a fortune teller or some kind of artificial intelligence, and what are their kind of responses as they type in different questions and get hilariously, often wrong answers? You don’t even have to ask it a question about a decision. You could ask it, “Is my hair red?” If your hair is red and it says “No,” then clearly it’s wrong and you’ll be discovered.
Now we’re going to be using something called the serial monitor later because you might be wondering, “Well, how do we actually tell the Brain Board our questions? I don’t see a keyboard on there,” and that’s a great point. We’re going to be doing it through the Arduino software. So we’ll do this in a moment, but you can see there’s a little box here on the screen and that box is where we type in our questions.
So I’ll show you some of the different parts of the serial monitor. You can see that you type here, the arrow points to a text box at the top, you click up the button that says “send to send”. I’m glad they did a good job on labelling of the software. And lastly, the Brain Board sends you its response there. So that’s an overview of how we’re going to be using this Decision Maker. So let’s jump to copying the sample code, sending it to the board, and seeing what happens.
So we’re back to looking at the sample code on the website and you’ll notice up the top here there are a number of strange patterns going on here and down the bottom we can see a little bit of text that says “ask me a question” and I will give you a yes/no answer and this is going to be important in a moment. But I’m going to click the copy button which will copy that code to my clipboard and now I’m going to head over to the Arduino software, paste it in and upload.
So I’ve opened the Arduino software. There we go, we have last week’s project open. I’m going to create a new file, close the other one, select all the text, backspace it, right click and paste it into the editor.
Don’t forget to select your port under the tools port menu and then select the option that says Arduino Uno. Click on that and now you’re free to upload. It’ll take a few seconds and you can track the progress of where it’s up to in the bottom right corner.
We’ll be asked in just a moment to save the sketch, give it a name, and this is a good way to make sure you lose your work. I’m going to call this the “decision maker”. Great. It’s saving, it’s compiling, and it’s going to send to the Brain Board. You’ll see that the lights flash as it uploads, and once it’s done we’re going to open the serial monitor.
You might be wondering, “Where do I find this magical portal to the brain of the Brain Board to to communicate with it?” Well, it’s over here in this top right corner. I’m going to close this web browser so we can see it a bit better. You can see it’s kind of like a magnifying glass icon with a dot in the middle. Let’s click on this now that the code is done uploading. This is going to launch a new window. Whoop, it had a little bit of a glitch there at the start but that’s okay. You can see here that it says “Ask Away”. It says “Ask me a question and I will give you a yes/no answer”.
And actually it’s pretty cool because the font that says “Ask Away” is made entirely out of letters and numbers. If you take a close look, there’s a bunch of zeros here, there’s a bunch of eights here, some little dashes, some parentheses going on. That’s pretty cool. So the way we ask a question is by clicking on this text box, sorry, up the top and typing in a question for the decision maker. I’m going to type in “Well, should I bake a cake today?” That was the example I had earlier. Let’s type that in. It says yes! Okay, well I know what I’m going to be doing after we finish up this string. I’m getting hungry already just thinking about it.
What else could we ask the decision maker? Will I receive any good presents for my birthday this year? Okay, I’ve typed it in, we’re going to find out. Oh, it says no. That’s not good news. I think I’ll have to speak with my parents and see if we can change that.
So I think now you can get a pretty good idea of how the decision maker works. You type in a question, you hit that send button, or you can press enter on your keyboard and it gives you a yes or no.
The way this really works is every time you hit the send button, it doesn’t even read the question. There’s a random number generator that goes on, and it either generates a zero or a one. If it’s a zero, it says no, and if it’s a one, it says yes. That’s how simple it is. But people think that there’s some kind of process that it’s thinking but it really isn’t. It’s completely random.
Now you might be wondering how we can change this to make it our own, to make it our own kind of decision maker, to give our own sort of personality to the invention. And we can do that through the code like we’ve been doing with all the previous inventions. Let’s head back to the computer and give it a look.
Okay so I’m going to close out of the serial monitor here and we’re going to look at the code here. I’ll I’ll expand it a little bit so we can fit more of the code on the screen. There we go. I’ve got a bit more room now.
If you take a look here, we have some text. It says, “Ask me a question and I will give a yes/no answer. \n.” Now the \n, all that means is a new line. So we’ll leave that intact. But maybe we can change the start of this. “Ask me a question.” Okay, I’m going to backspace that, but make sure you leave the quotation mark that opens that there, because otherwise your text will turn black and that means something’s going to go wrong. The green text is a good thing here. We’re going to say, “I am the Oracle. Ask me a question.” That seems pretty similar to before. Just say “I’m the Oracle.” Okay. Well, I didn’t need to backspace all that stuff. the oracle, ask me a question and I will give you a yes/no answer. Very mysterious.
You can also go down to here where it says “I say yes” and “I say no” and you can change the answers that happen for yes and no, sorry. I was going for something a little bit more dramatic, so I think I may just add an exclamation mark instead of a full stop and some extra letters at the end of these. “I say Yes! Oh, I think I need to put more ease for that kind of effect. Okay, yes! No can be… no! There we go. I’ve added extra bows. Oh, okay, great.
Let’s test that. I then have to select the port now because I already selected it earlier. I’m uploading it to the board and Here we go. It’s almost done. We’re done. Okay, I’m going to click on that serial monitor, open it up. Now if you do get all these funky things, all you have to do is press the clear output button and there’s a, if you see here, there is a pink button on the board. You can just press that and it will start the code again. And so you can see we have AskAway nice and clean. There’s not any extra random letters on there now.
Okay, so it says “I am the oracle, ask me a question” and I will give a yes/no answer. “Is the weather going to be fine this evening?” Wow, I somehow switched to formal writing mode. I say “Noooooo!” Now ask me something else.
There you have it guys, we’ve customised the decision maker but we can go even further. I just closed out of it, whoops, but you can see this Ask Away text. I think it’s time to change that and to do that we have the help of a fancy tool on EduKits that I created. It’s called the Fancy Text Generator. If you go over into, back onto the stream page, you’ll notice that there’s a link in the sidebar which links you to the fancy text generator.
If you click that you can head over to this side and you can generate your fancy text. Let’s take a look. So you can see it says fancy text generator and the text here is Annoyatron, but we can change that to whatever we want.
Under the your text box we can backspace and type in “I want it to be Oracle, because I’m saying this thing’s the Oracle. An Oracle, for those of you who don’t know, I probably should have mentioned this, is essentially someone who defines the future. Someone who… like a fortune teller essentially.
And you can see the text goes in here and suddenly the text is created in this cool font where it’s not really letters, it’s being made out of different symbols. And you click over here on the font and you can see that there are heaps of options. There’s 3D, diagonal, dancing, ghost, graffiti.
Just try a few out but one of my favourites is 3D slanted. That is really cool. Now what I want you to do is once you’ve found a style that you like, remember you can always pause and come back at any time. I’m not going anywhere. You want to click that “Copy Code” button and it says “Copied”. I click “Close”. It’s on our clipboard now.
Flip back to the Arduino application. Now here’s the fun but also slightly scary part where we delete the code, some of the code here, and then paste in the other stuff. Remember we’re not deleting all the code this time like we did last in some of our last inventions, we’re only deleting a portion. So the line numbers are going to be helpful here.
Select all the way from line 3 to line 11 and go all the way to line 11 and double check you’ve got your line numbers there. Those are the right line numbers and hit backspace. So now there’ll be a blank on line 3. So we’ve deleted that code there. Then right click and paste in the new code.
Okay, now I’m going to click the upload button and you’ll see that that sends to the Brain Board. And when we open the serial monitor, we’ll have that cool fancy font appear on the screen. Okay, done uploading. Oracle, I am the Oracle, ask me a question and I will give you a yes, no answer. How cool is that text? It’s amazing.
Now, this text, the way we just created the text using symbols was actually the way a lot of cool fonts were created. You may not know this, but computers originally, this is what they look like now, your smartphone, but originally they were these big, big machines. They didn’t have much storage.
They couldn’t show images. In fact, they only had one font on the computer. Can you imagine that? Only one font. And out of that one font, people figured out they could make different pictures using different letters, arranging the letters in certain patterns to make big letters. And that’s essentially what we did today. And it looks pretty cool, I think.
And that’s pretty much what the serial monitor is. It’s kind of like a version of that that carries into today that we can still use. When you use the serial monitor, when you use the decision maker, you’re going very retro. And I think that’s great.
Okay, well, we’ve successfully completed the invention, which is the decision maker, and now it’s time to move on to another exciting invention, which makes great use of the serial monitor. If you thought the decision maker was great, I think you’ll love the wacky word wizard even more.
Let’s go to the EduKits website and jump onto the page with the sample code we’ll be using, and then we can take a look at exactly how the Wacky Word Wizard works. So I’ll open up the EduKits website. We’ll go back to the Decision Maker page. I will scroll up to the top and you can see there’s a button that says View All Inventions under The Amazing Annoyatron.
If I click that, that’s another way we can head over to the page with all of the inventions on there. I’m going to scroll down now until we see the characteristic moustache of the Wacky Word Wizard. You know it’s got character. Let’s click on that and it will open the page for us in this browser tab.
Great, we’re here now and just scroll down to the code some chaos section, and then we’ll take a look at how this invention works. So at the start of this session, you will have heard me talk about the Wacky Word Wizard as something that comes up these ridiculous, hilarious sentences out of absolutely nowhere.
So the way it works is it asks for permission to be weird, so it’s a prompt you have to say yes, and then it invents a sentence. And here’s a kind of example of how this works. You can see it’s picking three random parts of a sentence and kind of mashing them together. These happen entirely randomly, kind of like how the decision maker’s decision was random.
And you can see how once we have permission to be weird, it puts the first part of the sentence, which happens to be “really”, “you don’t like”, and then the next part’s “feeding” and “the computer”. So you end up with a sentence that’s “really”, “you don’t like feeding the computer”, it makes no sense, but it’s one of the many weird, wacky, and wonderful sentences you’ll be creating with the wacky word wizard.
Let’s jump onto the sample code and take a look now that we’ve done that. Okay, so we’re back on the website, we’re getting ready to copy that sample code, and all you have to do like normal, sorry, like usual, is click that copy button, the code will copy to your clipboard, we can swap back over to the Arduino application.
I’ll close this serial monitor tab and we’ve pretty much finished up with this decision maker so I’ll click the new button to create a new code document and then I can close the other one. I’m going to file, save this, this is always good practice, and I’m going to type in wacky word wizard and this means that when we try to upload the code later on it’s not going to ask us to save because we’ve already done it. Great.
Then I can select all the code, delete it, paste in the new stuff, and we’re good to go. Let’s click this right-facing upload arrow, send the code to the board, and then open the serial monitor and test out the Wacky Word Wizard. I’ll show you how it works. Click on the serial monitor to open it, and it says “do you want me to tell you something?” So I am going to oblige and type in “yes” in this top textbooks. I’ll then click send and we’ll see what the worky word wizard says. Okay, so it’s saying “Well, your principal certainly doesn’t like being the computer.” What a crazy sentence!
Well, it’s asked us if we want to hear something else and well, I think we should… well, why not? Well, I absolutely hate going to school. I know at times I related to that one. You might as well.
Okay, so we’ve got the Wakcky Word Wizard, but I think it’s time to tweak it just a little bit. So let’s close it and take a look at the text here.
So if you remember from the with the decision maker, we can edit the text, the green text, within the quotation marks and that’s going to change what the serial monitor shows us, so the text we can interact with. The first one is “do you want me to tell you something?” and that’s on line 21 if you’re using the line numbers. And I’m going to change this to “do you want to hear something weird?”
Ooh, okay, that’s cool. Do you want to hear something weird? Hmm, and I don’t think I want to change the other answers. I want to change the actual text. So if you remember, we had something like, “Your principal certainly doesn’t like feeding computers.” Or even better, “I don’t like going to school.” That was what we had. And you can see that we have these things going on here. Word 1, String Word 2, and String Word 3.
So if you remember before, the Wacky Word Wizard works by selecting three random parts of a sentence and mashing them together. And you can see up here under String Word 1, Word 2, and Word 3, this is where we pull from. So we pick one section from String Word 1. This is the first part of the sentence, the opening. And then we stick it in the middle of, sorry, stick it next to a word from here, like being, having, saying, going, getting, making, knowing, telling, feeding. Or, sorry, and then we slap on, right at the end, the word three. A random one from that. So either school burgers, time machines, hospital. It’s essentially like a, well it’s like a burger. You have word one, you have word two, and then you have word three and they all get slap together to make a delicious hamburger of ridiculousness, which you can all laugh together with, with whoever’s around you at the time looking on.
So let’s change some of these words. There are actually a lot of them. So I don’t have the time to change all of them, but we can try to see if we get at least one of them. So now that we’ve changed some of the verbs, we can right-click this, sorry, we can click this right-facing upload arrow and send the code to the board for testing. It’s pretty much uploaded now. Okay, it’s done. I’m going to open this Syrian monitor. It says, do you want to hear something weird? Of course we do. That’s what we’re here for.
Okay, it’s saying, well, do you like bouncing me? It’s questionable, I’m going to remove that. Now that we’ve changed some of the verbs, we can click the right facing upload arrow and send the code to the board and see what happens. We’re going to be getting some new, exciting sentences, kind of like swapping out the beef patty on your burger for a chicken one.
Okay, I’m going to click this serial monitor, let’s open it up. Of course we want to hear something weird, that’s what we’re here for. It says “Well, do you like going to art?” I think it messed up with the space there a bit. That makes no sense. Well… I don’t like asking school. Interesting.
Well, I think that pretty much wraps up our Wacky Word Wizard for today. I hope you’ve enjoyed building this invention, along with the decision maker which we looked at earlier, because now it’s time to move over to our Q&A session, where we’ll be answering some of the questions you’ve been sending in throughout this livestream to our live stream email address, which is [email protected]. Let’s take a look at some of these questions now.
The first question today is, what are some of the other ways I can use the serial monitor? Well, it’s exciting that you ask that because one of the recent changes we’ve made to Code Kit, which is the app we used last week to do some coding, is that you can now use it to send messages over the serial monitor. I think we might be able to actually take a look at this now.
Let’s head over to the computer, swap back to the EduKits website. If you remember, you can find Code Kit by clicking the link in the top menu bar. You go into Code, Code, Code Kit, and then you can launch the web app, and that will open Code Kit in your browser window. Now, you might remember that we can change the different categories that are over here. in this section here. If you click on a category, a bunch of blocks pop up and these are sorted for us. So if we want logic blocks, we’ve got them in here. If we want timing blocks, like our delays, they’re in here. We can turn on a new category in this settings section.
So click on the settings icon, which is the cog, and you’ll have the settings menu. The item you want to select is this messaging option the bottom and I’ll turn a few of these off so we’ve got a bit more space here. And then we can click close. Now you can see here that we have loaded up a new, brand new, messaging category. If we click on that we have some options and I think the first thing to do would be to click this and say add this set serial bitrate block. Now you kind of have to turn on like you know it’s like you have to flick the switch to your computer you have to essentially tell the serial monitor you’re about to send stuff so that it’s listening. Change this number to 9600 I won’t go over why this is a little bit too complex for this video but set it to 9600 and then click on messaging and then you can say send message.
Now I did accidentally turn off the text the text box we need for this. So click close and wait for a moment. Here we go. Add a text block here, stick that in there and you can say “hi” and you can see over here the code is automatically generated for you. The code is generated in the right hand side section and you can click the copy code button if you like and it will send it to your clipboard.
Essentially what’s happening in this loop, if you look at the code over here, it’s going to print the word “Hi” over and over and over again. There might be a bit off-putting, so what you can do is add a delay underneath, which means that there will be a, in this case, 1000 millisecond or one second delay after each version of that message is sent. So it does not bombard you with a million things of the same message.
Okay, I think it’s time to go on to the next question. I I think I’ve taken a pretty thorough look at that. Okay. When did you first learn to code? Okay, I like that question. I think I talked about this in one of the previous sessions, but I learned to code when I was 10. I don’t think I went into as much detail as I’m about to go into.
I was always interested in computers. In fact, I had to kind of fix computers for a little while. My dad would bring home these broken computers from work. He’s an accountant, but the work essentially, his workplace had no use for them. They were broken, they didn’t work anymore. So he’d bring them home and I’d have a tinker and eventually these computers that were completely broken beyond repair would be suddenly up and running. And that was after I had opened them up, played around with the cables, and I just loved it. It was amazing. It was kind of like a puzzle to me. So coding for computers was really something that came quite naturally for me. I loved being able to write my own programs to see what I created pop up on the screen there, to know that what I was seeing was something I’d created, and I wanted to share that with that opportunity with other kids and other teenagers, and that’s why I created the Amazing Annoyatron, really.
So I started coding when I was 10, and since then I’ve been doing more and more of it, and now I’m really getting to do what I love. I’m getting to share that with other people. So thank you so much for tuning into today’s live stream. It’s been great having you with us. Tomorrow we’re going to be taking a look at two other inventions you can build with the amazing Inoue Tram to cap off this series of four live streams.
As I said before, thank you so much for tuning in and I’m looking forward to seeing you again in just a few short hours tomorrow. Well, it’s more like a day, but anyway. See you then.
[ Silence ]