Put a spin on your Easter celebration with this Easter Bot Hunt activity. Program your robot to make beeping sounds, dress it up as an easter egg, and hide it around your house or backyard. The hunt is on!
First, you’ll need to get started with a few programs, tools, and materials! Here’s a list of the things you’ll need:
You’ll also need to download your trick and costume!
Download the Costume: easter-bot-costume.pdf.
This is an Arduino activity, so make sure you download the program and the library here.
Once you’re all setup, check out a sample snippet of your code below. It’s much longer, but here’s what you should see.
#include <LittleRobotFriends.h>
boolean isInFindMode = false;
int timeBetweenBeeps = 5000;
unsigned long currentTime = 0;
unsigned long lastTime = 0;
LRFExpression foundMe =
{
.pattern = { LRFColor_Pink, LRFColor_Yellow, LRFTransform_Boomerang, LRFDuration_DoubleLong },
.sounds = {
{ LRFNote_C, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_Medium },
{ LRFNote_C, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_Medium },
{ LRFNote_D, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Long, LRFDuration_Short },
LRF_SOUND_BLANK
}
};
The program tells your robot when its hair sensor is tapped (tap = one touch). When this event is triggered your robot enters isInFindMode, which means it beeps every 5 seconds. After the hunt is done, give your robot a tickle on the hair (tickle = multiple touches) to put it in foundMe mode. Your robot will make an expression and the sound will turn off.
There are a few other important elements in the program. Check out the snippet of the setup code below:
void setup() {
lrf.setup();
lrf.setBoredomTimer(0);
lrf.disableEventExpressions();
lrf.setEventHandler(LRFEvent_Tap, myTapHandler);
lrf.setEventHandler(LRFEvent_Tickle, myTickleHandler);
lastTime = millis();
}
Your robot has default expressions already set on its firmware. void setup()
runs once, so you’ll need to turn off some default settings here. In this case, your robot’s boredom setting and default setting is disabled so it doesn’t disrupt your trick!
It’s time to upload the Easter Bot Hunt trick onto your robot. You’ll need to connect your robot to the computer with the USB cable.
Make sure your board and port is connected, then simple click the upload button!
You’ll know when the trick is uploaded onto your robot when the Arduino Sketch says “Upload Complete”.
Print the costume out on regular paper, or cardstock paper if you want it to last longer. Whip out the pencil crayons, markers, and scissors. Secure the costume onto your robot with a bit of tape and you’re done!
Download your costume, here!
Make sure you print your costume in Actual Size, otherwise it won’t fit!
Hide your robot around the house or the backyard. See if your family and friends can find your Easter Bot!
If you want to take this activity one step further, try completing the challenges below.
Change the timing in between your robot’s beeps. Make them longer or shorter. Here’s a hint - you’ll want to change the section of the code below.
int timeBetweenBeeps = 5000;
Make your robot beep three times while it’s in search mode. Here’s a hint - you’ll want to change the section of the code below.
LRFExpression beep =
{
.pattern = { LRFColor_Red, LRFColor_Purple, LRFTransform_Boomerang, LRFDuration_DoubleLong },
.sounds = {
{ LRFNote_C, LRFOctave_3, LRFIntonation_Falling, LRFDuration_Short, LRFDuration_Medium },
LRF_SOUND_BLANK,
LRF_SOUND_BLANK,
LRF_SOUND_BLANK
}
};
Make your robot sing when it is found. Here’s a hint - you’ll want to use LRFSong instead of LRFExpression. Why’s this? You’ll need more notes! Expressions can only contain four-notes. A song can contain up to one hundred notes.
LRFExpression foundMe =
{
.pattern = { LRFColor_Pink, LRFColor_Yellow, LRFTransform_Boomerang, LRFDuration_DoubleLong },
.sounds = {
{ LRFNote_C, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_Medium },
{ LRFNote_C, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_Medium },
{ LRFNote_D, LRFOctave_3, LRFIntonation_Rising, LRFDuration_Long, LRFDuration_Short },
LRF_SOUND_BLANK
}
};