Hi everybody, my name is Massimo Banzi, and I'm one of the co-founders of Arduino.
Welcome to the 5th and last video in a series of videos about the Arduino Robot, sponsored by RS Components.
In this video, David Cuartielles and Xun Yang are going to explain to you how to use the screen that you can see on the Arduino Robot,
and how to make music with the Arduino Robot.
So this is going to be a fun episode, and I'm sure you're going to enjoy it.
So, I leave it to you, David.
Hello and welcome to our 5th video on the series on how to use the Arduino Robot.
Today, we're going to explore two extra features that come with the robot, thanks to it carrying the TFT screen and sound speaker.
Today we're going to see how to show images on the screen and how to play sound.
We'll start by having Xun explain to you how to play sound with the robot.
So the robot is a very powerful platform for playing 8-bit music actually, thanks to our friend David Taylor
and his Squawk library. And we even commissioned three different music from local artists
which we'll be playing in the robot examples. And now we're going to show you the example of disco robot,
in which we ask the robot to do a bit of disco dancing.
It will be moving around and also making some really nice music.
So I just open the example on the ID while Xun plugs in the cable. I'm going to just briefly explain to you how it works.
As usual, we have to load the Arduino Robot library, and the robot is programmed to make different turns,
either stops, turns left or right or forwards or backwards, as it's playing music.
The dance script is stored as a string, as you can see up here that it ends with a 0 marker.
And it has three songs. One is called melody, the second one is called menu, and the final one is called chase.
We have these three songs because in the different examples for the Arduino Robot we basically run three different types of activities.
We either are navigating a menu, like in the hello user example, we are having the official song for the robot,
which is called melody, and finally, we might be following a line or looking for an object, etc.
and then we use the chase melody. You can create your own music using a tracker software.
So let's just upload this program to the robot.
And it will start playing music directly.
So this is our first music.
And you can change to other music by pressing either the left or right button.
So we're using a very powerful software library that allows us to play four different song lines at the same time on a single digital pin.
You can of course use that library in other places.
For our next example we're going to see how to upload and use images inside the Arduino Robot.
You can store images inside the SD card on the robot.
This SD card can carry different images as well as sound files like the one we were just experimenting with.
We need to connect it to the computer, so we use a converter from micro-SD to SD, plug it into my laptop,
and then I can navigate through the folder to see what comes with the micro-SD card.
In this case, what I'm going to do is create a small .bmp picture that I will upload to the card,
and we will then load it on the screen to see how it works.
I open my software, to create the images, in this case I'm using GIMP
You can use anything from Windows clip art and anything that ends up being a .bmp file.
And create a new file. Our files are 128 pixels x 160 pixels and with a color resolution of 24 bits.
And, there you go.
I did my picture, and we end up having in this case RS logo type that I'm going to show on the robot screen,
I just need to export it as... a .bmp picture. Just for brevity I will call it RS.bmp
And I click on export.
And I have to make sure I chose the right options, so I'm going to choose 24 bits for the color depth, and export.
Then, once the file is recorded, I can close my software and just copy the file into the SD card.
So it's kept on my downloads folder, and down here I will find RS.bmp. There it is. I can just drag it and drop it on my SD card up here
and .... export. So here it is.
You just plug it in there.
In the meanwhile, on the computer you're going to see the program that I'm going to use to load the image,
it's a very simple example created especially for this.
This example, as usual starts by instantiating the Arduino Robot library,
starts the use of the SD card, starts the screen, starts the robot, and just draws the .bmp picture RS.bmp
It's going to be very simple. Plug it to the computer and we upload the program.
You can see now, you can see how we just took the same image that we had in our computer and we're showing it on the robot screen.
So, Xun actually made a really good example that is making use of the compass to navigate through pictures,
so we'll just upload it to the robot and let Xun explain to you how this works.
This is our example called Picture Browser.
So basically we'll see a photo gallery software that you can control with two different ways,
one is just using the left and right button, another is, actually you can switch to the next photo by shaking the robot
or tilting it.
So you can see a few images that's stored in the micro-SD card, and if you click the up button,
it changes to the different control mode, then if you tilt it really quick...
So in today's episode, we showed you how to display images and play 8-bit music by having the files stored in a micro-SD card
which can be accessed through the micro-SD reader that's on the TFT screen.
This was our last episode on the Arduino Robot series, shot for you by RS Components. Thanks for watching!
Okay that was great! So this is the last video in the series, I hope you enjoyed it, thank you David, thank you Xun
for the work you've done in this series, and thank you RS Components for sponsoring the videos.
So please let us know in the comments what you liked, what you didn't like, what you've learned,
post videos of your robots doing different things you programmed them to do,
and let us know how much you enjoy the robot and play with it. Thank you!