1
00:00:02,580 --> 00:00:05,600
So we're going to use the second switch.

2
00:00:06,570 --> 00:00:14,920
It's already been enabled and set to an input for us because we use an in our comparison algorithm overhead

3
00:00:14,930 --> 00:00:20,070
we've enabled the switch and we've already set it as an input.

4
00:00:20,070 --> 00:00:26,010
So all we have to do now is create a condition in which this switch will be used currently said one

5
00:00:26,010 --> 00:00:29,540
switch one switch on 10 green.

6
00:00:29,610 --> 00:00:32,330
We're going to create another switch on.

7
00:00:32,760 --> 00:00:34,390
We're going to call this first one.

8
00:00:34,470 --> 00:00:42,700
Switch one on the and we're going to create another comparison.

9
00:00:43,020 --> 00:00:51,900
We're going to create another compact for the next switch or we have to do types GMP are similar to

10
00:00:52,380 --> 00:00:53,200
ours here.

11
00:00:53,250 --> 00:00:58,880
Then we compare what serial X once here.

12
00:00:58,930 --> 00:01:02,880
Remember when switch to is pressed on this one becomes here.

13
00:01:02,950 --> 00:01:09,520
That's when we know when we're going to tell it to crunch if it's equal cue to switch to

14
00:01:14,700 --> 00:01:21,910
going to say switch to on and or we have to do is come down here to create the subroutine phosphorus

15
00:01:21,930 --> 00:01:31,340
to on switch to ON THE SCHOOL on we're going to move the color green into our Here

16
00:01:36,390 --> 00:01:36,740
I'll.

17
00:01:36,740 --> 00:01:37,750
This one says Green.

18
00:01:37,760 --> 00:01:42,450
This move threat here from our other example we moved Green to remove.

19
00:01:42,600 --> 00:01:44,150
Now I love to.

20
00:01:44,660 --> 00:01:46,030
Ken let's move.

21
00:01:46,380 --> 00:01:50,090
And this runs to output.

22
00:01:50,090 --> 00:01:55,610
So now we don't need to create a new output subroutine the old one would suffice.

23
00:01:56,030 --> 00:02:03,230
And then the crimes to loop Yes so let's see what we have here.

24
00:02:03,460 --> 00:02:12,470
Let's see compare and then we'll branch here and then output and then we'll compare if it's this okay.

25
00:02:12,530 --> 00:02:13,790
This looks good.

26
00:02:13,790 --> 00:02:16,530
Let's try it on our good.

27
00:02:16,940 --> 00:02:18,500
Okay.

28
00:02:18,590 --> 00:02:21,710
No errors okay.

29
00:02:21,730 --> 00:02:24,770
Download successful reset

30
00:02:28,620 --> 00:02:29,290
show.

31
00:02:29,370 --> 00:02:32,180
Now we don't have ready yet.

32
00:02:32,340 --> 00:02:40,200
What we're going to do is tell the microcontroller that if pressed the switches one and two then ten

33
00:02:40,230 --> 00:02:41,660
on red.

34
00:02:42,100 --> 00:02:49,720
So we're going to compare again for we have to do now this compares and P

35
00:02:52,130 --> 00:02:58,200
SMP are serious value with remember it's logic low switches.

36
00:02:58,210 --> 00:03:04,260
So if it's serious you then both of them are pressed so they are on.

37
00:03:04,260 --> 00:03:10,710
So if we have serious you both switches one and two are correct we're going to say if this is the case

38
00:03:11,010 --> 00:03:12,550
grind to two

39
00:03:16,570 --> 00:03:27,370
both switches like this and all we have to do now is create the subroutine for both switches and assign

40
00:03:27,370 --> 00:03:28,700
a color for it.

41
00:03:28,820 --> 00:03:32,090
So I'm going to come here like this sir.

42
00:03:32,640 --> 00:03:42,070
Those the school switches and I'm going to move the color red to show that when we press both of them

43
00:03:42,250 --> 00:03:55,100
red it turns on it has come upon sine and then the L output and go back to our Luke and we have done

44
00:03:56,360 --> 00:03:57,410
show.

45
00:03:57,980 --> 00:04:00,550
Let's compile and let the compiler charge.

46
00:04:00,890 --> 00:04:18,180
Well sure errors let's download onto our board download complete reset see.

47
00:04:18,350 --> 00:04:19,900
Congratulations.

48
00:04:19,910 --> 00:04:25,250
I hope you get some more and more excited so we can play around with this.

49
00:04:25,250 --> 00:04:33,260
We can play would have more in fact we can mix colors we can mix blue with red and see what we come

50
00:04:33,260 --> 00:04:34,260
up with.

51
00:04:34,310 --> 00:04:36,250
I'll leave that for you as a challenge.

52
00:04:36,270 --> 00:04:43,670
Try mixing blue red and see what color you get or red green and crime mix in all three colors and you

53
00:04:43,670 --> 00:04:45,970
should get something that looks like white.

54
00:04:46,220 --> 00:04:48,080
So that is your homework.
