Gamify your chain reaction by using a Strawbees grabber connected to Makey Makey to start a timer in Scratch when you grab a conductive egg. Drop the egg on the Strawbees roller coaster track. When the egg rolls into the egg drop, it stops the timer.
|Build Strawbees Inventions
Some resources to get you started playing with these chain reaction elements:
The Strawbees roller coaster track tutorialThe Strawbees Mechanical Arm or Grabber
Here is what our full project in action looks like!
|Code a Timer in Scratch and Recorder Variable
To create a timer in Scratch, you'll want to create a variable and name it "Seconds timer." You need to code your timer to "set to 0" when the green flag is clicked.
To have the timer start with a key press, use the "When up arrow is pressed" hat to trigger the timer. Place a "wait 1 sec" stacking block from the control palette in side a "forever" loop and attach a "change seconds timer by 1" to the "wait 1 sec block. Now Scratch will count up by 1 second forever! This is one quick and easy way to code your own timer.
You'll want to use another key press to stop the timer. By placing the "if __ then" block underneath the "change timer by" block, you can tell Scratch what to do if another key is pressed. Find the "key pressed" sensing block in the sensing palette. This block checks to see if a specific key is pressed.
So our code here is triggered by the up arrow and changes the timer by 1 every second forever unless the "space" key is pressed. If the "space key is pressed" then the timer script is stopped.
To record the time it takes for your egg to drop, you need the following code to set the "record time." For fun we also added a cloud variable, so for now, our way to check if we need to "record the time" is set to record if it is less than the current longest time of our "longest time variable."
See our full Scratch game here, and use the code pictures below to help you with your Scratch project.
|Make Strawbees Grabber into a Makey Makey Switch
In this step, you are going to make your grabber into a Makey Makey switch! You'll wire one grabber to the "up arrow" to start the timer, and the other side of the grabber to "EARTH." When the two sides pick up the foil covered egg (or ball) it will complete the circuit and start the timer in Scratch.
Making a Connection
To wire the grabber, you'll use foil for the hands, and some conductive copper tape to create your wiring. Make sure the two copper traces never touch or you will accidentally set off your circuit. For the hinges, we left the backing on our tape so it could be flexible. (Like a bandaid!)
Then hook one alligator clip to your straw and the "up arrow" and one alligator clip to the other connection and "EARTH."
|Create an Egg Drop Landing Switch
Build your Egg drop lander however you want! Ours was designed by an 11 YO. To wire the landing bed as a switch, use two copper tape traces and connect some foil to the edge of your Strawbees landing pad. Make sure there is an air gap between the two flaps of foil. When the egg lands on the foil, it will press the two pieces together and trigger the "space key" on your Makey Makey.
We used this STL file from Strawbees Inventor Erik Thorstensson to attach our Makey Makey to the Strawbees Egg drop landing pad.
|Connect Makey Makey to Scratch
Plug in your USB and test your start and stop timer! Here is the whole project described and played during our webinar with Strawbees!
We'd love to see your projects! Make sure to tag us on social if you make something like this project.