Imagine a situation, in which you lost one very important book under your bed. But it is very dark under there, and maybe some monsters even live there (just joking)! What device would you use to light up the space under the bed? Can we build this device using Robo’s blocks?
Let’s decide what blocks we need to build a Robo-Flashlight. Think of a flashlight, what are its parts? What does a flashlight do? Can it be switched on and off? Can you maybe even draw a sketch of a flashlight? Here is our idea:
Our magic Robo-Flashlight is built, but how did we get it to glow? In order to make a robot do anything, we have to give it the right instructions — by creating some code.
Do you feel like you need to refresh some Robo Code App basics before making the project? Check out our How-to-Code tutorial here.
We want to code our flashlight to do the following:
Open the Robo Code App, connect to your robot & create a new project.
Drag and drop two Constant Light Actions on the Coding Screen.
Change the setting for the first Constant Light Action to 0 brightness; this means the light will be off. Choose any color you want for the second Constant Light Action, this will be the color of your magic Robo-flashlight.
The flashlight should turn on and off when you click the Button. We need to instruct the robot to wait for our command. So let’s set the Lifespans for both of the Constant Light Action to infinite. This means that the robot will wait forever (infinite) for you to click the button.
Connect the Constant Light Actions into a Loop, this means that our flashlight will be working all the time.
What is missing? The Button Trigger! This trigger gives the robot the instructions to turn the light on and off when the red button is pressed. Let’s add the Button Trigger on both Connections, so we can switch our flashlight on and off.
Are we ready to test it out? Yes! Press Play to try out your code, press on the Button to switch your flashlight on/off.
Now we can use our flashlight to find the book that’s under our bed without being afraid of any monsters. Great work!
(You can find the answer key to these challenges at the end of the page).
Here are some games you can play with your magic Robo-Flashlight.
Create your own starry sky in your room! Use some black paper or card stock and draw stars on it. Cut these stars out using small scissors. Be careful while using the scissors! Turn the flashlight on and attach your card to it. Enjoy the starry sky!
Create your own shadow theater and perform your favorite story.
Here is a great tutorial on how it can be done:
Play this one with your friends! The rules are the same as for a regular hide and seek but just in the dark. Use your magic flashlight to become a detective who finds everyone!
Think of another game where you can use your magic Robo-Device!
STEAM & Project Based Approach
Imagine that you are going to do a project and you think: What will I learn at the end? Here are the learning outcomes formulated from “I” perspective:
Use the same code. Change the settings for both Button Triggers to “Clicked 2 times”. Done! Press Play and see how quickly you can click 2 times!
Use the same code. Change the settings for the first Button Trigger to “Pressed” and the settings for the second Button Trigger to “Released”. Try out!
Start a new project. Drag & Drop 7 Constant Light Actions to your coding screen. Set their colors to rainbow colors in the order of the rainbow (for example: red, orange, yellow etc). Now set the Lifespan to infinite for each Action. Connect them all into the Loop. Now add the Button Triggers to all 7 Connections. Push the button and your Rainbow-Flashlight is ready to glow!
You've completed the Magic Robo-Flashlight! How was your experience? We would love to hear your feedback here.