Get ready to design your favourite Ice Princess! In this activity, program an Ice Princess to sing a cover of ‘Let It Go’. Craft a fabulous costume for your character and let the show begin!
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 song and costume!
Download the Costume: ice-princess-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>
LRFSong let_it_go =
{
.length = 60,
.octaveShift = 0,
.pattern =
{ LRFColor_Red, LRFColor_Blue, LRFTransform_Random, LRFDuration_DoubleLong },
.sounds = {
{ LRFNote_F, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_G, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_GS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleMedium, LRFDuration_Medium },
{ LRFNote_DS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_DS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_AS, LRFOctave_5, LRFIntonation_Flat, LRFDuration_DoubleMedium, LRFDuration_Medium },
The program tells your robot when its hair sensor is tapped (tap = one touch). When this event is triggered your robot will sing ‘Let It Go’. That’s 60 lines of song code!
There are a few other important elements in the program. Check out the snippet of the setup code below:
void setup() {
lrf.motion.disable();
lrf.hearing.disable();
lrf.sight.disable();
lrf.setup();
lrf.setEventHandler(LRFEvent_Tap, myTapHandler);
lrf.setBoredomTimer(0);
}
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 motion, hearing, sight, and boredom timer is disabled so it doesn’t disrupt the beautiful singing voice of your robot!
It’s time to upload the Let It Go song 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”.
Tap your robot’s hair sensor to trigger the song!
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!
If you want to take this activity one step further, try completing a few of these challenges!
Change the Event Handler that triggers your song. Make it sing every time you blow into the sound sensor!
void setup() {
lrf.motion.disable();
lrf.hearing.disable();
lrf.sight.disable();
lrf.setup();
lrf.setEventHandler(LRFEvent_Tap, myTapHandler);
lrf.setBoredomTimer(0);
}
The current code only has 60 lines of the song. See if you can add 20 or 40 more to complete the song! Don’t forget, you need to change the value in .length when you add more notes.
LRFSong let_it_go =
{
.length = 60,
.octaveShift = 0,
.pattern =
{ LRFColor_Red, LRFColor_Blue, LRFTransform_Random, LRFDuration_DoubleLong },
.sounds = {
{ LRFNote_F, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_G, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_GS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleMedium, LRFDuration_Medium },
{ LRFNote_DS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_DS, LRFOctave_4, LRFIntonation_Flat, LRFDuration_DoubleShort, LRFDuration_DoubleShort },
{ LRFNote_AS, LRFOctave_5, LRFIntonation_Flat, LRFDuration_DoubleMedium, LRFDuration_Medium },
Design a costume for your favourite Ice Princess’ sister! Try getting two robots to sing together with the infrared sensor. Face them in front of each other and give one character a Big Hug (hold both hand sensors, then release). They’ll sing a duet!