WEBVTT

00:00.300 --> 00:06.270
In this lesson, I will show you how to install the Arduino ID on the Raspberry Pi so you can program

00:06.270 --> 00:08.090
your Arduino directly from there.

00:08.100 --> 00:13.590
And let's first understand very quickly why this can save you a lot of time.

00:13.860 --> 00:20.310
So if you already have the original ID on your computer, what you can do is to write some program for

00:20.310 --> 00:20.950
your Arduino.

00:20.970 --> 00:23.460
Let's say you are on Windows Mac or Linux.

00:23.460 --> 00:24.720
It doesn't really matter.

00:24.720 --> 00:27.940
And then you upload the program to the Arduino.

00:27.960 --> 00:33.720
Then when we will make the Raspberry Pi and the original communicate between each other, you will need

00:33.720 --> 00:40.260
to unplug the Arduino from your computer, plug it to your Raspberry Pi, and then run a Python program

00:40.260 --> 00:42.870
to communicate on the Raspberry Pi.

00:43.170 --> 00:49.650
And every time you need to modify something in the Arduino code, you will need to do this process again,

00:49.650 --> 00:57.570
which is basically to unplug from the PI plug to the computer upload and plug and plug to the Raspberry

00:57.570 --> 00:58.530
Pi again.

00:58.830 --> 01:04.260
Now what you can do is directly install the Arduino ID on the Raspberry Pi OS.

01:04.290 --> 01:08.910
By doing that, you can keep the Arduino board plugged to your Raspberry Pi board.

01:09.060 --> 01:15.540
Any time you need to modify the original program, you simply need to stop any current program running

01:15.540 --> 01:18.960
on the Raspberry Pi, which is communicating with the Arduino.

01:18.960 --> 01:23.040
And then you just upload the code and run the program again.

01:23.040 --> 01:23.880
That's it.

01:24.090 --> 01:24.630
All right.

01:24.630 --> 01:30.120
Now let's go to the Raspberry Pi OS desktop and install the Arduino ID.

01:31.250 --> 01:34.130
So Raspberry Pi desktop is actually Linux.

01:34.130 --> 01:40.610
So we are going to do the Linux installation and if you open a terminal, well you could install Arduino

01:40.610 --> 01:44.390
IDE directly with APT, but don't do that.

01:44.780 --> 01:47.950
So you could do pseudo apt install Arduino.

01:47.960 --> 01:53.720
You may see that in some tutorials, but don't do that because this version is actually old and not

01:53.720 --> 01:54.500
updated.

01:54.680 --> 01:59.070
So you're not going to have the new features and maybe that's not going to work.

01:59.090 --> 02:03.710
So instead we are going to open a web browser here on the Raspberry Pi.

02:04.580 --> 02:07.760
And just type of, you know, I.

02:09.740 --> 02:15.320
And so just search on DuckDuckGo, on Google or whatever search engine you want.

02:15.500 --> 02:18.260
Let's go to the website.

02:19.400 --> 02:22.100
And here we are not on the right page.

02:22.100 --> 02:23.960
So let's go to software.

02:23.960 --> 02:25.370
So you click on software.

02:26.990 --> 02:33.800
And you have downloads and ID, so just download the latest original ID version.

02:34.050 --> 02:36.890
Doesn't really matter which version you have or not.

02:36.920 --> 02:39.620
So on the right you can see the download options.

02:39.860 --> 02:46.570
So if you were to use Windows or macOS instead of the Raspberry Pi to actually program, you are going

02:46.580 --> 02:48.200
to then download one of those.

02:48.200 --> 02:52.250
But here we are on Linux, we are on Raspberry Pi, so we are on Linux.

02:52.250 --> 02:59.540
So we are going to download one of those here of Linux and to know if you have 32 or 64 bits.

02:59.540 --> 03:01.340
Well, it's simple.

03:01.340 --> 03:10.820
Just open a terminal again and do your name Space Dash M This is going to show you that.

03:10.820 --> 03:16.460
And if you see av7l, it means you have a 32 bit.

03:16.580 --> 03:21.740
If you have something like x 86, 64, you have 64 bit.

03:21.740 --> 03:24.170
So we know we have 32 bit here.

03:25.890 --> 03:32.190
And we are going to use the a r 32 so you don't load that one.

03:33.550 --> 03:36.220
Okay, you can just click on just download.

03:38.710 --> 03:41.240
And you can see it's going to download it here.

03:41.260 --> 03:44.830
So you just wait until it has been downloaded.

03:46.270 --> 03:46.690
All right.

03:46.690 --> 03:50.940
We know have the Arduino IDE downloaded.

03:50.950 --> 03:56.770
So I'm going to close this Web browser and let's open the terminal again.

03:57.070 --> 03:57.520
All right.

03:57.520 --> 04:02.230
And as a reminder here, you have to have some basics on Raspberry Pi, including the terminal.

04:02.230 --> 04:08.500
So I'm going to show you exactly what commands I use, but I'm not going to explain everything 100%

04:08.500 --> 04:09.780
from scratch.

04:09.790 --> 04:11.800
So we are in the home directory.

04:11.800 --> 04:15.370
I'm going to go to the downloads folder.

04:15.850 --> 04:18.880
In the downloads folder, we have this.

04:18.880 --> 04:22.750
So that's the archive we have downloaded from the original website.

04:22.960 --> 04:33.910
This is a tab, so we are going to do the space dash x f with the name of the archive.

04:34.800 --> 04:39.180
So you can just use the other completion with TAB if you want to go faster.

04:39.390 --> 04:40.680
You press enter.

04:40.830 --> 04:44.520
You wait a few seconds, maybe even a few minutes.

04:45.870 --> 04:46.410
All right.

04:46.410 --> 04:53.700
And when the command returns, LZ, you see we have a new folder which contains the original ID.

04:53.850 --> 05:00.710
Now, what you're going to do is to move this inside the slash opt folder of your Raspberry Pi.

05:00.720 --> 05:06.930
So you're going to do pseudo pseudo because we are going to put that somewhere else than in your home

05:06.930 --> 05:07.650
directory.

05:07.950 --> 05:17.640
So pseudo m v to move, you just use the to completion to select the folder and then you do slash it

05:18.450 --> 05:19.920
with auto completion.

05:19.920 --> 05:21.750
Also, you press enter.

05:22.440 --> 05:23.970
All right, now the folder is gone.

05:23.970 --> 05:25.240
You go to city.

05:25.260 --> 05:34.830
So city slash OPD ls we have so we have other stuff here as well and we have the avenue ID so we are

05:34.830 --> 05:43.260
going to go inside this folder and now you can see we have this, we have a few scripts here and some

05:43.260 --> 05:52.260
folders, but basically what we're going to do is to run this install dot s h, so pseudo dot forward

05:52.260 --> 05:57.210
slash installed dot and you wait a few seconds.

05:59.790 --> 06:00.050
Okay.

06:00.090 --> 06:04.980
And when you see down well, Arduino ID is successfully installed.

06:05.010 --> 06:11.760
Just one more thing is if you want to uninstall it, you just go back to this folder here and you just

06:11.760 --> 06:17.250
run the uninstall script and then you can also remove that folder if you want to.

06:17.430 --> 06:20.170
All right, but let's keep our annoyed installed.

06:20.190 --> 06:27.630
I'm going to close the terminal now and you can see here we should have on the menu programming and

06:27.630 --> 06:31.950
we have a new Arduino IDE icon here, so I'm going to click on that.

06:34.040 --> 06:37.190
OC and Arduino is now open.

06:37.190 --> 06:45.560
And you see you have a new program here and now just one or two things about configuration so that you

06:45.560 --> 06:50.390
can have a better looking IDE and that the code can be more readable.

06:50.420 --> 06:53.600
You're going to go in file preferences.

06:54.900 --> 06:57.060
And you can edit different things.

06:57.060 --> 07:01.830
For example, editor font size, I'm going to put 14 here.

07:02.280 --> 07:05.700
I'm going also to use display line numbers.

07:05.910 --> 07:08.100
So I'm going to change those two options here.

07:08.700 --> 07:10.100
Let's click on Okay.

07:10.110 --> 07:12.600
And you can see it's already better.

07:12.720 --> 07:17.550
I'm going to go back to preferences and where you already have another information.

07:17.550 --> 07:20.420
Here is where your sketchbook is.

07:20.430 --> 07:24.500
So sketchbook is basically where your original programs are going to be saved.

07:24.510 --> 07:31.380
So you have a new Arduino folder here on your home directory.

07:32.780 --> 07:36.410
And the last thing I'm going to do is I'm going to go down here.

07:36.410 --> 07:42.610
More preferences can be edited directly in the file here, so I'm going to click on that.

07:42.620 --> 07:47.960
This is going to open a new file manager and I'm going to close.

07:47.960 --> 07:48.950
That's very important.

07:48.950 --> 07:51.440
You're going to close the original IDE.

07:52.190 --> 07:55.640
We are going to modify preferences that text here.

07:55.850 --> 08:01.070
And before you open that file, you close the Arduino ID very important.

08:01.070 --> 08:02.660
So you double click.

08:03.440 --> 08:10.490
You're going to open the file, and this is because we're going to find this line ed dot font.

08:10.940 --> 08:13.670
So you can just crawl and find this line.

08:14.240 --> 08:15.620
Edit All dot font.

08:15.650 --> 08:22.850
You see, we have mono spaced by default, and this may actually not be the most readable font for Arduino.

08:22.940 --> 08:30.050
So what you can do if you want to change to console us here like this, you write like this, console

08:30.050 --> 08:31.490
us and then you have plane.

08:31.490 --> 08:33.500
So don't touch anything here.

08:33.500 --> 08:35.840
Anyway, that setting doesn't work.

08:35.840 --> 08:39.440
And then you see you also have the font size that we have just said before.

08:39.440 --> 08:43.790
But for the font, basically there is no way to change it on the Arduino settings.

08:43.790 --> 08:47.840
So we have to open these preferences, that txt file.

08:47.930 --> 08:55.490
So I'm going to save with control SE and now I quit the file and quit that.

08:55.490 --> 08:57.830
And let's go back to Arduino ID.

09:00.090 --> 09:03.930
All right, Now we have a new font size.

09:04.880 --> 09:07.970
And a new font and we have the line numbers.

09:07.970 --> 09:10.520
So everything is good for the course.

09:10.610 --> 09:17.810
Now, if you plug your Arduino to your Raspberry Pi with the USB cable, then you go on tools.

09:18.290 --> 09:20.770
You select board Arduino UNO.

09:20.780 --> 09:25.190
So if you have an Arduino, no, of course, if you have something different, like a nano or mega,

09:25.190 --> 09:27.200
you choose the correct board.

09:27.200 --> 09:29.930
And then on board, you're going to choose the Arduino.

09:30.500 --> 09:38.630
So usually that's going to be something like T, y, AC and zero or tie USB zero or with one or something

09:38.630 --> 09:38.990
like that.

09:39.320 --> 09:45.380
So you select this and then let's just upload an empty program to see if it works.

09:45.830 --> 09:49.510
So compiling, uploading, down, uploading, great.

09:49.520 --> 09:51.660
Everything is correctly working.

09:51.680 --> 09:52.100
All right.

09:52.100 --> 09:54.480
So now we have all the tools we need.

09:54.500 --> 10:00.680
Let's jump straight into the cellular communication so we can make the Raspberry Pi and the Arduino

10:00.680 --> 10:02.660
board talk to each other.
