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 first and kiss off our hardware, which is the SPF30 tool.

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,160 --> 00:00:47,540
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 woman.

12
00:01:00,580 --> 00:01:06,070
We have the lead set to default, which is led number 13 on Arduino.

13
00:01:06,790 --> 00:01:10,120
So we need to change this little number.

14
00:01:10,690 --> 00:01:17,620
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,620 --> 00:01:17,890
two.

16
00:01:18,730 --> 00:01:24,070
It is important to check if Lid Polychain is automatically recognized by IEEE.

17
00:01:24,400 --> 00:01:29,710
If not, you must add to code a line like this light and.

18
00:01:33,300 --> 00:01:44,480
And I cleared it, let's copy it and based it here and now you have to write to to make sure that the

19
00:01:44,490 --> 00:01:55,290
codes will be saved to pin number two, which is the internal lid pin inside the sport.

20
00:01:56,130 --> 00:01:57,780
Now let's save our codes.

21
00:02:04,460 --> 00:02:05,930
Let's leave the name blank.

22
00:02:07,160 --> 00:02:08,539
And let's roll this.

23
00:02:10,740 --> 00:02:16,980
Now, as you can see, it's the very same code that we use, and we have two methods.

24
00:02:17,460 --> 00:02:20,490
The void setup method and the void normally filled.

25
00:02:21,420 --> 00:02:30,180
The Void setup method is basically where you set up things like up in here we have the number two,

26
00:02:30,390 --> 00:02:35,340
which is valid variable and we can replace it with number two here.

27
00:02:35,790 --> 00:02:40,440
But since we are using a variable, we can load the variable name here and here.

28
00:02:40,440 --> 00:02:42,720
We can assign it as input or output.

29
00:02:43,170 --> 00:02:45,930
Since we are dealing with added, it's an output.

30
00:02:45,930 --> 00:02:54,420
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:56,010
the setup loop.

32
00:02:56,430 --> 00:03:03,000
Now, the loop function from its name, it will keep repeating itself.

33
00:03:03,000 --> 00:03:05,760
The loop function runs over and over again forever.

34
00:03:06,990 --> 00:03:11,850
Once you stop the program or stop, turn off the power, it will stop running.

35
00:03:12,420 --> 00:03:21,060
Now the digital right will write a digital value high means one logic or turn on to this pen, which

36
00:03:21,060 --> 00:03:23,960
has been no tool that has internal LED.

37
00:03:24,530 --> 00:03:27,480
Then the delay sentence will wait for a second.

38
00:03:28,080 --> 00:03:31,140
And we will have the same sentence that right?

39
00:03:31,320 --> 00:03:38,190
We will write a digital value which is low or zero or off, and we will wait for another two seconds

40
00:03:38,190 --> 00:03:40,200
so it will turn on valid.

41
00:03:40,860 --> 00:03:45,780
Wait a second, turn it off and wait another second now before.

42
00:03:46,990 --> 00:03:51,760
Uploading this code, we need to go and make sure that we have that do it.

43
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.

44
00:03:59,380 --> 00:04:01,990
After that, we can simply click Upload.

45
00:04:07,800 --> 00:04:09,000
It will take some time.

46
00:04:09,480 --> 00:04:09,930
OK.

47
00:04:10,560 --> 00:04:14,970
As you can see, you now have an error because this is a system variable.

48
00:04:15,570 --> 00:04:18,990
We can't change it with another name to.

49
00:04:22,770 --> 00:04:23,820
Let's try it again.

50
00:04:41,950 --> 00:04:46,030
As you can see now, it's writing the code done uploading.

51
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.

52
00:05:00,770 --> 00:05:01,290
That's it.

53
00:05:01,310 --> 00:05:04,940
This is how simple it is to turn on or off.

54
00:05:05,300 --> 00:05:12,680
And you can use any other pin or connect an external LED if you have one, but that's it for this last

55
00:05:12,680 --> 00:05:12,960
one.

56
00:05:12,980 --> 00:05:16,550
As you can see, it's the very same code that we use and Arduino.

57
00:05:17,360 --> 00:05:18,800
So it's really simple.

58
00:05:19,790 --> 00:05:22,230
It's really easy to get started with this ball.

59
00:05:22,610 --> 00:05:27,710
You don't have a lot of knowledge, just basic knowledge and coding on it and an Arduino.

60
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.

61
00:05:34,100 --> 00:05:37,970
If you have any question about anything, please ask Invece on the board.

62
00:05:40,320 --> 00:05:41,190
Thanks for watching.

63
00:05:45,540 --> 00:05:47,910
This is Ashraf from educational engineering team.

