In this lesson, I will show you how to install the Arduino ID on the Raspberry Pi so you can program
your Arduino directly from there.
And let's first understand very quickly why this can save you a lot of time.
So if you already have the original ID on your computer, what you can do is to write some program for
your Arduino.
Let's say you are on Windows Mac or Linux.
It doesn't really matter.
And then you upload the program to the Arduino.
Then when we will make the Raspberry Pi and the original communicate between each other, you will need
to unplug the Arduino from your computer, plug it to your Raspberry Pi, and then run a Python program
to communicate on the Raspberry Pi.
And every time you need to modify something in the Arduino code, you will need to do this process again,
which is basically to unplug from the PI plug to the computer upload and plug and plug to the Raspberry
Pi again.
Now what you can do is directly install the Arduino ID on the Raspberry Pi OS.
By doing that, you can keep the Arduino board plugged to your Raspberry Pi board.
Any time you need to modify the original program, you simply need to stop any current program running
on the Raspberry Pi, which is communicating with the Arduino.
And then you just upload the code and run the program again.
That's it.
All right.
Now let's go to the Raspberry Pi OS desktop and install the Arduino ID.
So Raspberry Pi desktop is actually Linux.
So we are going to do the Linux installation and if you open a terminal, well you could install Arduino
IDE directly with APT, but don't do that.
So you could do pseudo apt install Arduino.
You may see that in some tutorials, but don't do that because this version is actually old and not
updated.
So you're not going to have the new features and maybe that's not going to work.
So instead we are going to open a web browser here on the Raspberry Pi.
And just type of, you know, I.
And so just search on DuckDuckGo, on Google or whatever search engine you want.
Let's go to the website.
And here we are not on the right page.
So let's go to software.
So you click on software.
And you have downloads and ID, so just download the latest original ID version.
Doesn't really matter which version you have or not.
So on the right you can see the download options.
So if you were to use Windows or macOS instead of the Raspberry Pi to actually program, you are going
to then download one of those.
But here we are on Linux, we are on Raspberry Pi, so we are on Linux.
So we are going to download one of those here of Linux and to know if you have 32 or 64 bits.
Well, it's simple.
Just open a terminal again and do your name Space Dash M This is going to show you that.
And if you see av7l, it means you have a 32 bit.
If you have something like x 86, 64, you have 64 bit.
So we know we have 32 bit here.
And we are going to use the a r 32 so you don't load that one.
Okay, you can just click on just download.
And you can see it's going to download it here.
So you just wait until it has been downloaded.
All right.
We know have the Arduino IDE downloaded.
So I'm going to close this Web browser and let's open the terminal again.
All right.
And as a reminder here, you have to have some basics on Raspberry Pi, including the terminal.
So I'm going to show you exactly what commands I use, but I'm not going to explain everything 100%
from scratch.
So we are in the home directory.
I'm going to go to the downloads folder.
In the downloads folder, we have this.
So that's the archive we have downloaded from the original website.
This is a tab, so we are going to do the space dash x f with the name of the archive.
So you can just use the other completion with TAB if you want to go faster.
You press enter.
You wait a few seconds, maybe even a few minutes.
All right.
And when the command returns, LZ, you see we have a new folder which contains the original ID.
Now, what you're going to do is to move this inside the slash opt folder of your Raspberry Pi.
So you're going to do pseudo pseudo because we are going to put that somewhere else than in your home
directory.
So pseudo m v to move, you just use the to completion to select the folder and then you do slash it
with auto completion.
Also, you press enter.
All right, now the folder is gone.
You go to city.
So city slash OPD ls we have so we have other stuff here as well and we have the avenue ID so we are
going to go inside this folder and now you can see we have this, we have a few scripts here and some
folders, but basically what we're going to do is to run this install dot s h, so pseudo dot forward
slash installed dot and you wait a few seconds.
Okay.
And when you see down well, Arduino ID is successfully installed.
Just one more thing is if you want to uninstall it, you just go back to this folder here and you just
run the uninstall script and then you can also remove that folder if you want to.
All right, but let's keep our annoyed installed.
I'm going to close the terminal now and you can see here we should have on the menu programming and
we have a new Arduino IDE icon here, so I'm going to click on that.
OC and Arduino is now open.
And you see you have a new program here and now just one or two things about configuration so that you
can have a better looking IDE and that the code can be more readable.
You're going to go in file preferences.
And you can edit different things.
For example, editor font size, I'm going to put 14 here.
I'm going also to use display line numbers.
So I'm going to change those two options here.
Let's click on Okay.
And you can see it's already better.
I'm going to go back to preferences and where you already have another information.
Here is where your sketchbook is.
So sketchbook is basically where your original programs are going to be saved.
So you have a new Arduino folder here on your home directory.
And the last thing I'm going to do is I'm going to go down here.
More preferences can be edited directly in the file here, so I'm going to click on that.
This is going to open a new file manager and I'm going to close.
That's very important.
You're going to close the original IDE.
We are going to modify preferences that text here.
And before you open that file, you close the Arduino ID very important.
So you double click.
You're going to open the file, and this is because we're going to find this line ed dot font.
So you can just crawl and find this line.
Edit All dot font.
You see, we have mono spaced by default, and this may actually not be the most readable font for Arduino.
So what you can do if you want to change to console us here like this, you write like this, console
us and then you have plane.
So don't touch anything here.
Anyway, that setting doesn't work.
And then you see you also have the font size that we have just said before.
But for the font, basically there is no way to change it on the Arduino settings.
So we have to open these preferences, that txt file.
So I'm going to save with control SE and now I quit the file and quit that.
And let's go back to Arduino ID.
All right, Now we have a new font size.
And a new font and we have the line numbers.
So everything is good for the course.
Now, if you plug your Arduino to your Raspberry Pi with the USB cable, then you go on tools.
You select board Arduino UNO.
So if you have an Arduino, no, of course, if you have something different, like a nano or mega,
you choose the correct board.
And then on board, you're going to choose the Arduino.
So usually that's going to be something like T, y, AC and zero or tie USB zero or with one or something
like that.
So you select this and then let's just upload an empty program to see if it works.
So compiling, uploading, down, uploading, great.
Everything is correctly working.
All right.
So now we have all the tools we need.
Let's jump straight into the cellular communication so we can make the Raspberry Pi and the Arduino
board talk to each other.