The new Code-a-Key Backpack! Bringing the Makey Makey and the BBC micro:bit together for more invention fun!

Maker Class Lesson Five: Using Secret Codes to a Create a Makey Makey Life Cycle Project

Want to know how to use order and sequence to trigger special effects in your Scratch projects online? In this guide, you'll learn how to code sequence and secret code projects and how to connect them to drawings or other physical elements in the real world that trigger animations in the digital world!    

Creating a Sequence Project

Want to know how to use order and sequence to trigger special effects in your Scratch projects online? In this guide, you'll learn how to code sequence and secret code projects and how to connect them to drawings or other physical elements in the real world that trigger animations in the digital world!

The process of connecting the physical world to the digital world is known as physical computing! You've been creating some really cool physical computing projects so far, even if you didn't know it! Now you are going to learn how you can further develop how the physical aspects of your project by incorporating the secret code extension in Scratch. 

In this class, you'll create a secret code based on a sequence of key presses. For this project, we will focus on coding drawings or a poster, but in the next class, you will learn to use secret codes to build a secret code cardboard invention.

Our example project is sharing the life cycle of a butterfly, but you can make your sequence project about anything you want! So start brainstorming what life cycle you want to share in your Scratch project and drawings.

Invention Literacy Vocabulary: 

Physical Computing

Combining the physical world with the digital world. Physical computing takes a hands-on approach to computing. The physical aspect of the project and how a human interacts with the physical components are just as important as the coding and computing side of the project!

Sequence and Algorithm

Sequencing in computing is very important! A computer can only follow the set of instructions you give it. So if you code the wrong steps, your algorithm won't respond correctly. In this project, you'll learn how to code a sequence that triggers a special effect in your Scratch project. 

Sequencing is the specific order in which instructions are performed in an algorithm. In your life cycle project, you will code your drawings to trigger a special effect in Scratch, but only if the user inputs the correct sequence!

 

Drawing Images for Life Cycle

Now that you've chosen (and hopefully researched) a life cycle you want to share in your Scratch project, it's time to draw!

Draw at least four images to represent different stages of the life cycle you've chosen.

You can draw your images in order, but you actually want the player of your game to figure out the right order. In our example, we have the drawings out of order as a way to test the player!  

If you have a 6B pencil, use it to draw your images! The higher the number on a pencil, the more graphite the pencil lays down when drawing. (See the experiment in this class where we tested pencil lead types and check out this pencil experiment video.)

If you don't have a 6B pencil, you can still use other pencils, just remember to make very thick and dark marks so there is a lot of graphite (pencil lead) on the paper. The thicker, the better! You also need a lot of pencil lead for the alligator to clip to grip.

If you need more help with your drawings, revisit this class on drawing musical circuits.

Coding Basic Inputs for Drawings

The coding for each keypress is similar to previous projects. If you want to add some sound to your project, check out the "Text to Speech" extension in Scratch. 

This block allows you to type what you want your character to say, and you can even change the languages! 

Set the Voice, language, and then tell about each life cycle on the key press that goes with the drawing you created. 

Download and print a pdf of "Coding a Makey Makey Life Cycle Project" for students

Basic Code

Code each arrow key to display a sprite when pressed and speak the step of the life cycle. (Record audio or use text to speech extension.)

Code for Sequence

The second hat block in the Makey Makey extension is a sequence block. Using this code, the sprite will only show after the keys are pressed in sequence. 

To trigger this butterfly to show, press up, right, down, then left and the butterfly will appear!

You can add animations and code movement. For a code only close up check the second image. (Viewing tip: Right click to open the image in a new tab to get a close up read of the Scratch code blocks!)

 

Use the Secret Code Extension to Trigger Animation

Now that you have the basic project done, let's use the idea of sequence to trigger a special effect. 

    Remember that sequencing is the specific order in which instructions are performed in an algorithm. In order for your player to trigger the secret code block, they will have to touch the images in the correct order. 

    The secret code hat will set the sequence. Any blocks you place under this hat will only be triggered when the player presses the keys in the correct order.

    When the keys "up right down left" are pressed in order,  what do you want to happen?

    In our project, we used the secret code hat to broadcast a message to make our butterfly fly. By using random variables for x and y we were able to code our butterfly to flutter. 

     

    Sequence/ Algorithm

    The player has to touch the drawings in order to trigger the animation in Scratch:

      • Up Arrow connected to the Egg Drawing
      • Right Arrow connected to the Caterpillar
      • Down Arrow Connected to Pupa/Chrysalis Drawing
      • Left Arrow Connected to the Butterfly Drawing

    (See our Scratch Project here.)

    Going Further with Inventions - Creating Life Cycle Posters

    Remember our class on crafting and coding interactive stories? How can you use the interactive poster idea to recreate your life cycle project into something even more physical and three dimensional? Can you use a poster to make an intriguing sequence project? Can you create logic puzzles on paper for your friends to puzzle out and solve mysteries coded in a Scratch project? Here are some everyday office supplies you can use to make a secret code interactive poster! 

    Remember these important vocabulary terms around inventing! Prototype a few different ideas and share your iterations with friends to improve your design ideas!

    Invention Literacy Vocabulary: 

    Prototyping is the first step to inventing. A prototype is an early or beginning model of an idea (generally an invention.) Inventors prototype ideas to test the concept of their inventions. If a prototype is still buggy or doesn't work right, an inventor will create another version of their idea.

    Iteration is the next step of prototyping. An inventor will continue to draft and rework their ideas by making more versions or iterations of a design idea. Once you start inventing, you'll want to make multiple versions of your idea to make sure you have a successful prototype or invention idea!

    Want to Create your own Sequence Variable?

    What if you want to use a different combination of keys that aren't available in the extension? In our next class, we'll teach you how to do just that! Create your own sequence variables and use them in your secret code inventions! 

     

    Time Investment
    45 min
    Grades:
    4-12 

    Supplies

    • Makey Makey Classic
    • 6B Pencils
    • Poster Paper
    • Office Supplies: Brass fasteners, paperclips, binder clips, etc.

    Welcome

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pharetra, ligula non mollis pretium, lectus libero sodales augue, interdum auctor mauris dui non risus. Nulla facilisi. Nunc rutrum diam in elit sagittis eget viverra erat viverra. Morbi imperdiet aliquet libero vel rhoncus. Integer.