So we're going to use the second switch.
It's already been enabled and set to an input for us because we use an in our comparison algorithm overhead
we've enabled the switch and we've already set it as an input.
So all we have to do now is create a condition in which this switch will be used currently said one
switch one switch on 10 green.
We're going to create another switch on.
We're going to call this first one.
Switch one on the and we're going to create another comparison.
We're going to create another compact for the next switch or we have to do types GMP are similar to
ours here.
Then we compare what serial X once here.
Remember when switch to is pressed on this one becomes here.
That's when we know when we're going to tell it to crunch if it's equal cue to switch to
going to say switch to on and or we have to do is come down here to create the subroutine phosphorus
to on switch to ON THE SCHOOL on we're going to move the color green into our Here
I'll.
This one says Green.
This move threat here from our other example we moved Green to remove.
Now I love to.
Ken let's move.
And this runs to output.
So now we don't need to create a new output subroutine the old one would suffice.
And then the crimes to loop Yes so let's see what we have here.
Let's see compare and then we'll branch here and then output and then we'll compare if it's this okay.
This looks good.
Let's try it on our good.
Okay.
No errors okay.
Download successful reset
show.
Now we don't have ready yet.
What we're going to do is tell the microcontroller that if pressed the switches one and two then ten
on red.
So we're going to compare again for we have to do now this compares and P
SMP are serious value with remember it's logic low switches.
So if it's serious you then both of them are pressed so they are on.
So if we have serious you both switches one and two are correct we're going to say if this is the case
grind to two
both switches like this and all we have to do now is create the subroutine for both switches and assign
a color for it.
So I'm going to come here like this sir.
Those the school switches and I'm going to move the color red to show that when we press both of them
red it turns on it has come upon sine and then the L output and go back to our Luke and we have done
show.
Let's compile and let the compiler charge.
Well sure errors let's download onto our board download complete reset see.
Congratulations.
I hope you get some more and more excited so we can play around with this.
We can play would have more in fact we can mix colors we can mix blue with red and see what we come
up with.
I'll leave that for you as a challenge.
Try mixing blue red and see what color you get or red green and crime mix in all three colors and you
should get something that looks like white.
So that is your homework.