Little Robot Friends
Arduino Library Reference
version 1.1
|
This tutorial uses example code found in:
MyLRF03_BlinkAndSay.cppGreat work! Your Little Robot Friend has learned to sing. Time to put together what you’ve learned so far in order to make something really special. Now that we have a simple understanding of making patterns and sounds, what we really want to do is combine them to make full-blown robot expressions.
There are a couple simple functions for doing this called lrf.blinkAndSay(). Once you’ve defined a pattern and a sound, you can combine them using this function. The following code is copied from the examples in Tutorials 1-3. Let’s start with a very simple combination of two colours with one sound. By now, the content and format should look pretty familiar.
After you’ve decided on the colours and sound, you can plug both variables into the lrf.blinkAndSay() function in setup()
.
Once you’ve been able to get this to work we can experiment with multi-sound expressions that allow us to use an array of sounds to give our robot even more character.
Now you can add simply add a second lrf.blinkAndSay() function in void setup that can contain both your colours and your sound, or just your sound. Don’t forget to label your array!
That's it! Now you can make full-blown robot expressions. Time to get creative!