1 00:00:00,990 --> 00:00:06,960 Hello and we'll come to you and so on and we'll talk about how you can enjoy the program. 2 00:00:06,960 --> 00:00:08,300 Pick it up. 3 00:00:09,530 --> 00:00:15,840 Will start with a very simple flashlight example just to show you how things are and how things can 4 00:00:15,840 --> 00:00:16,670 be done. 5 00:00:17,040 --> 00:00:21,740 And Mike we'll see ID on environment using C language. 6 00:00:22,020 --> 00:00:27,670 If you're not I mean with this you should check our cost control or step by step. 7 00:00:27,660 --> 00:00:29,190 You're probably right. 8 00:00:29,310 --> 00:00:34,190 So let's start by opening bankruptcy. 9 00:00:34,210 --> 00:00:36,700 This is the software that we are going to use. 10 00:00:36,700 --> 00:00:39,100 It's called Michael Seabrook. 11 00:00:40,180 --> 00:00:49,720 Now go to find new your project Next choose type of pics that you are going to use and the software 12 00:00:49,720 --> 00:00:51,980 as you can see here isn't showing any. 13 00:00:52,270 --> 00:00:57,830 So let's go back and try again now. 14 00:00:57,870 --> 00:00:59,120 It was loading. 15 00:00:59,560 --> 00:01:00,060 OK. 16 00:01:00,100 --> 00:01:01,530 Now we want to choose. 17 00:01:01,530 --> 00:01:02,770 Pick it. 18 00:01:03,190 --> 00:01:06,130 Four thousand five hundred fifty. 19 00:01:06,160 --> 00:01:08,500 It's one of the very most common. 20 00:01:08,510 --> 00:01:10,440 Pick it. 21 00:01:11,100 --> 00:01:15,590 Next we want to take the stand to be 20 make a Hertz next. 22 00:01:15,670 --> 00:01:23,020 You can choose file name or where you want to save it and then OK. 23 00:01:23,160 --> 00:01:26,110 Let me choose. 24 00:01:26,660 --> 00:01:40,960 It's either for documents this is it could me choose the name first flush on it you know. 25 00:01:41,180 --> 00:01:43,260 Now next next next. 26 00:01:43,310 --> 00:01:46,310 Then finish. 27 00:01:46,370 --> 00:01:59,170 Now as you can see form is very small so go to Tools Options then go to Edit or appears. 28 00:02:01,030 --> 00:02:05,160 Editor settings then click here. 29 00:02:05,510 --> 00:02:13,160 Open options they are low as you can see edit a font change it to whatever you want. 30 00:02:13,190 --> 00:02:16,410 I would choose 20. 31 00:02:16,480 --> 00:02:18,940 As you can see now it's bigger. 32 00:02:18,940 --> 00:02:24,830 I will go even more to me blame all clear for you. 33 00:02:26,720 --> 00:02:27,200 OK. 34 00:02:27,370 --> 00:02:28,790 Now we have it. 35 00:02:29,410 --> 00:02:30,150 We have a void. 36 00:02:30,150 --> 00:02:34,340 Man this is the main method that we are going to write our code in. 37 00:02:34,570 --> 00:02:37,700 So let's start by assigning board B. 38 00:02:38,260 --> 00:02:47,160 Trace the as out of zero x 0 0 we discussed the naming mechanism. 39 00:02:47,160 --> 00:02:53,090 If you want to name bit by bit and if you want to end the entire board at once. 40 00:02:53,180 --> 00:02:58,550 0 0 in hexadecimal means eight zeros and binary. 41 00:02:58,750 --> 00:03:01,640 So all of these pins will be out with friends. 42 00:03:01,840 --> 00:03:10,950 As we mentioned earlier again if you are not familiar you should go and take our beginner to advance 43 00:03:10,990 --> 00:03:16,480 pick micro-controller programming and simulation course or just drop us and I. 44 00:03:16,480 --> 00:03:25,770 Now the next thing we want to do is to turn off Port d to begin with. 45 00:03:25,840 --> 00:03:33,350 So we should write the turning off is more that you should do. 46 00:03:34,610 --> 00:03:44,440 No matter what's your called and no matter what you are going to accomplish your coding because the 47 00:03:44,440 --> 00:03:52,270 first thing that you need to make is making to do is making sure that the board doesn't have any previous 48 00:03:52,270 --> 00:03:55,670 values so make it all zeros. 49 00:03:56,170 --> 00:04:00,910 Now we want our flash out to repeat itself indefinitely. 50 00:04:00,940 --> 00:04:08,150 So we must add it in a room. 51 00:04:08,540 --> 00:04:18,500 So while one school will run indefinitely inside that world we want to turn on the port the then turn 52 00:04:18,500 --> 00:04:19,100 it off. 53 00:04:19,100 --> 00:04:23,990 As we mentioned earlier unlike pick 16 off we want yours. 54 00:04:23,990 --> 00:04:26,300 The report was just up here. 55 00:04:26,330 --> 00:04:29,640 We will use that not just for outputting data. 56 00:04:29,990 --> 00:04:41,140 And we didn't mention this in the briefs so we should write a lot the equal z x f. 57 00:04:41,480 --> 00:04:43,530 Then we must add a delay. 58 00:04:43,820 --> 00:04:52,680 Which is simply a a function millisecond and 500 milliseconds. 59 00:04:53,300 --> 00:05:00,720 They didn't just copy and paste the same thing but change this to zero zero. 60 00:05:01,370 --> 00:05:03,690 So now what this code will do. 61 00:05:03,830 --> 00:05:07,840 Let's combine it with that we don't have any of. 62 00:05:09,890 --> 00:05:10,530 OK. 63 00:05:10,650 --> 00:05:21,080 Now after compiling as you can see we assign part D as output after we add initialize or initialized 64 00:05:21,170 --> 00:05:24,690 for the to be all zeros. 65 00:05:24,730 --> 00:05:27,750 Then we add indefinite. 66 00:05:27,950 --> 00:05:31,530 Low and slow and we turn on. 67 00:05:31,620 --> 00:05:40,570 Pulled the pins waited for 500 milliseconds which is half a second just to notice this change which 68 00:05:40,570 --> 00:05:42,140 is dead and gone. 69 00:05:42,310 --> 00:05:52,750 Then we turned off for the using 0 0 0 and again we had that delay so that we can see a turning off 70 00:05:53,050 --> 00:06:04,440 mechanism that said this is how to write a code for pick 18 and to show you what combos we can pick 71 00:06:04,530 --> 00:06:08,190 it off and pick 16 if we want to do the same thing. 72 00:06:08,190 --> 00:06:10,360 We need to change these lines to Paul 73 00:06:13,090 --> 00:06:18,720 the equals zero x of hands. 74 00:06:18,730 --> 00:06:29,910 We need to change just these two lights this one k this one and this one for the zero x zero zero. 75 00:06:30,150 --> 00:06:39,290 So and pick 16 af we can use that pool for unbought and outworks wine and pick 18. 76 00:06:39,360 --> 00:06:44,830 And as you can see here support just that is only used for input wine. 77 00:06:44,860 --> 00:06:48,120 We used to do this stuff for outwitting that. 78 00:06:48,470 --> 00:06:56,600 So again this is to confirm that this is the main difference between programming in C language for picketing 79 00:06:56,750 --> 00:07:05,990 of this side compared to back 16 of next simulation of the score. 80 00:07:06,120 --> 00:07:13,520 See how this shuttled where we will take another example on how to input data. 81 00:07:13,810 --> 00:07:16,380 We did this example to 82 00:07:19,260 --> 00:07:25,700 let's say if statement so that we can read input data from the user. 83 00:07:25,760 --> 00:07:30,270 Stay tuned if you have any questions about this code please ask in the kitchen table. 84 00:07:30,380 --> 00:07:31,250 Thanks for watching. 85 00:07:31,250 --> 00:07:34,030 This is educational engineering team.