1
00:00:00,720 --> 00:00:02,520
Hello, and welcome to this annual lesson.

2
00:00:03,660 --> 00:00:12,390
As usual, the first thing that we do when we start exploring a new hardware is to blink alid or to

3
00:00:12,390 --> 00:00:19,650
write a programming sentence, which is Hello Earth and kiss all our hardware, which is SB thirty two.

4
00:00:20,160 --> 00:00:22,860
That example will be led blinking.

5
00:00:23,610 --> 00:00:35,400
So let's go to the examples menu and the Arduino IEEE and open up the sketch example or plink example.

6
00:00:36,300 --> 00:00:36,840
Now.

7
00:00:38,110 --> 00:00:40,360
As you can see, we have a lot of examples here.

8
00:00:41,170 --> 00:00:44,520
You can go to the basics and click Blink.

9
00:00:46,150 --> 00:00:47,530
Now, let's close this window.

10
00:00:48,570 --> 00:00:51,480
Let's open up this one now.

11
00:00:53,000 --> 00:00:58,700
As you can see in this lesson on Discord, that means a woman.

12
00:01:00,560 --> 00:01:06,040
We have the lead set to default, which is led number 13, an Arduino.

13
00:01:06,770 --> 00:01:10,130
So we need to change this little number.

14
00:01:10,700 --> 00:01:17,630
As you know, the SB 32 has a built in lid that is connected to its general purpose input output number

15
00:01:17,630 --> 00:01:17,880
two.

16
00:01:18,740 --> 00:01:24,080
It is important to check if lid position is automatically recognized by IEEE.

17
00:01:24,410 --> 00:01:29,690
If not, you must add to code align like this light and.

18
00:01:33,320 --> 00:01:44,480
And likelihood, let's go be it on the basis that here and now you have to tool to make sure that the

19
00:01:44,480 --> 00:01:55,280
codes will be saved to pin number two, which is the internal lid pin inside the sport.

20
00:01:56,120 --> 00:01:57,770
Now let's save our code.

21
00:02:04,460 --> 00:02:05,930
Let's leave the name blank.

22
00:02:07,160 --> 00:02:08,540
And let's roll this.

23
00:02:10,750 --> 00:02:16,990
Now you can see it's the very same code that we used, and we have two methods.

24
00:02:17,470 --> 00:02:26,920
The Void Setup Method and the Void Law filled the void setup method is basically where you set up things

25
00:02:26,920 --> 00:02:34,810
like up in here we have pin number two, which is the lead variable, and we can replace it with number

26
00:02:34,810 --> 00:02:35,350
two here.

27
00:02:35,770 --> 00:02:40,450
But since we are using a variable, we can apply the variable name here and here.

28
00:02:40,450 --> 00:02:42,730
We can assign it as input or output.

29
00:02:43,150 --> 00:02:45,940
Since we are dealing with added it's an output.

30
00:02:45,940 --> 00:02:54,430
So we write output and we use Benmore function to make sure that we set pin number two as output in

31
00:02:54,430 --> 00:02:55,990
the setup loop.

32
00:02:56,440 --> 00:03:02,950
Now the loop function from its name, it will keep repeating itself.

33
00:03:02,980 --> 00:03:05,770
The loop function runs over and over again forever.

34
00:03:07,000 --> 00:03:10,450
Once you stop the program or stop, turn off the power.

35
00:03:10,840 --> 00:03:11,860
It will stop running.

36
00:03:12,430 --> 00:03:15,310
Now the digital right will write a digital value.

37
00:03:15,860 --> 00:03:23,980
Hi means one logic or turn on to this pin, which has been no tool that has internal LED.

38
00:03:24,520 --> 00:03:27,490
Then the delay sentence will wait for a second.

39
00:03:28,090 --> 00:03:31,150
And we would have the same sentence that right?

40
00:03:31,300 --> 00:03:38,170
We would like a digital value which is low or zero or off, and we will wait for another two seconds

41
00:03:38,170 --> 00:03:40,180
so it will turn on valid.

42
00:03:40,870 --> 00:03:45,790
Wait a second, turn it off and wait another second now before.

43
00:03:46,990 --> 00:03:51,760
Uploading this code, we need to go and make sure that we have that do it.

44
00:03:51,850 --> 00:03:58,450
Yes, P32 Dev Kit version one selected and we need to make sure that we have the right compost.

45
00:03:59,380 --> 00:04:01,990
After that, we can simply click Upload.

46
00:04:07,800 --> 00:04:09,000
It will take some time.

47
00:04:09,480 --> 00:04:09,930
OK.

48
00:04:10,560 --> 00:04:17,880
As you can see, you now have an error because this is a system variable, we can't change it with another

49
00:04:17,880 --> 00:04:18,990
name led to.

50
00:04:22,770 --> 00:04:23,820
Let's try it again.

51
00:04:41,920 --> 00:04:46,030
As you can see now, it's writing the code done uploading.

52
00:04:47,560 --> 00:04:55,570
Now, if you have the board, you can see that there is a blue LED blinking on and off.

53
00:05:00,770 --> 00:05:01,290
That's it.

54
00:05:01,310 --> 00:05:10,120
This is how simple it is to turn on or off, and you can use any other pin or connect an external LED

55
00:05:10,130 --> 00:05:11,010
if you have one.

56
00:05:11,600 --> 00:05:12,960
But that's it for this last one.

57
00:05:12,980 --> 00:05:16,550
As you can see, it's the very same code that we use and Arduino.

58
00:05:17,360 --> 00:05:18,800
So it's really simple.

59
00:05:19,790 --> 00:05:22,230
It's really easy to get started with this ball.

60
00:05:22,610 --> 00:05:27,710
You don't have a lot of knowledge, just basic knowledge in coding and an Arduino.

61
00:05:28,160 --> 00:05:33,620
And if you don't have a basic knowledge, I already explained each line of code inside this sketch.

62
00:05:34,100 --> 00:05:37,970
If you have any question about anything, please ask Invece on the board.

63
00:05:40,320 --> 00:05:41,190
Thanks for watching.

64
00:05:45,540 --> 00:05:47,910
This is Ashraf from educational engineering team.
