WEBVTT

00:00.240 --> 00:07.230
In this lesson, I'm going to introduce you to a new Avenue ID debug tool, which is named the Serial

00:07.230 --> 00:07.800
Plotter.

00:07.980 --> 00:15.700
And as its name suggests, you will be able to plot what comes in the serial communication.

00:15.720 --> 00:21.880
So this will be useful, for example, here, like we are going to do to see directly with a plot.

00:21.900 --> 00:23.760
What is the burden state.

00:23.790 --> 00:31.800
So I'm going to go back to so I'm going to open the push button so you can go back to your project and

00:31.800 --> 00:33.660
just will just open.

00:35.050 --> 00:37.150
The push button example.

00:37.390 --> 00:39.780
So here we define the button pin.

00:39.790 --> 00:45.280
We set the mode for the pin as input and we set up the cellular communication.

00:45.490 --> 00:50.620
Now, what I'm going to do in the loop, I'm simply going to do.

00:51.480 --> 00:53.640
Sale dots print n.

00:55.280 --> 00:59.210
Digital read button in.

01:00.490 --> 01:06.880
Okay, so I'm just going to print the output of the pin key and command those lines.

01:08.150 --> 01:11.720
Okay, I'm going to print it at full speed this time.

01:12.020 --> 01:15.800
No delay so I can upload the code to the available.

01:17.510 --> 01:19.010
For uploading and uploading.

01:19.010 --> 01:22.250
If you open the soil monitor, you will see it's going very fast.

01:23.120 --> 01:24.070
Very, very fast.

01:24.080 --> 01:26.510
If I press the button, it's going very fast.

01:26.990 --> 01:35.270
And now to open the style plotter, you can go on tools and cellular plotter and you can see the shortcut

01:35.270 --> 01:44.240
here, for example, on Windows control shift and l so say plotter, and you get a new window with a

01:44.240 --> 01:44.920
plot.

01:44.930 --> 01:47.840
So on the bottom of the window, you can see here the board, Right.

01:47.840 --> 01:53.660
So make sure you have the same board right in your program and in the sale plot.

01:54.260 --> 01:59.900
And on the bottom right here, you should have no line ending as well.

02:00.620 --> 02:06.710
Now, what I'm going to do is I'm going to press the button and you can see here we have by here you

02:06.710 --> 02:08.030
have the value zero.

02:08.030 --> 02:09.380
You have the value three here.

02:09.380 --> 02:10.870
So this is one.

02:10.880 --> 02:13.970
Now, if I release the button, we go back to zero.

02:13.970 --> 02:18.320
So you can easily visualize when you price and when you release the button.

02:19.670 --> 02:23.610
We are going to come back to this tool a bit later on this course.

02:23.630 --> 02:30.950
So this is really a nice to have functionality with your Arduino is to be able to directly print the

02:30.950 --> 02:37.820
data from a sensor and note that to do that you should directly send the data you want to print.

02:38.150 --> 02:41.270
Don't send any other text or any other data.

02:41.270 --> 02:42.440
Just send the data.

02:42.440 --> 02:47.720
So this could be digital rate for a button pin, or this could be simply you can try.

02:47.720 --> 02:55.430
Also to do that is to create a counter and increment the counter every time and print on the cell communication.

02:55.430 --> 03:00.710
And then with the cell plotter you should see the plot with all the numbers that you send.

03:00.920 --> 03:05.210
And if you are on Tinker CAD, you can also use the cell plotter.

03:05.210 --> 03:12.920
So if you run the code like this, you can click on cell monitor and you have this icon here that you

03:12.920 --> 03:18.410
can click on total graph and you can see let's just put it a bit bigger.

03:18.410 --> 03:19.940
You can see we have the graph here.

03:19.940 --> 03:23.510
And so now if I press on the push button.

03:25.280 --> 03:29.530
You can see I release and then I press and then I release.

03:29.540 --> 03:34.970
You can see the data is going from 0 to 1 and then 0 to 1, etc. back to zero.

03:36.050 --> 03:40.670
So you can do the side plotter as well on Tinker Cat.

03:40.700 --> 03:41.180
All right.

03:41.180 --> 03:45.870
Now you know how to use digital pins as output and input.

03:45.890 --> 03:47.090
Congratulations.

03:47.090 --> 03:50.600
And it's no time to switch to analog pins.
