And here is the complete code.
So after September 11 for the simulation as well.
So the only difference here is that for the iPod Remote Library, I use Division two and Division three
because that's what's on the available with Dinko.
So very quickly, what are the differences?
Well, you can see the button mapping is different.
I don't use decimal numbers.
I use hexadecimal numbers with zero X, so I have marked here previously the button.
We have done that previously in a previous section.
So when you map the button to make sure you take the hexadecimal value, just the decimal value and
you put that here, but that will be different, of course, from the simulation and the real hardware.
Then I have some here specific to version two.
I have those two lines to initialize the I receive and decode the results here and then everything is
the same.
I just go to the void setup and I have a different way to initialize the implied receiver as well as
in the loop, a different way to read the results that value and to decode function is different.
So you only need to change those few lines of code if you want to toggle between the version two and
three of the library and then the rest is the same.
Make sure you use long for the command and know I'm going to start the simulation by racing here and
the code you can see initializing.
And then distance, you have the distance here, and with this you can set a different distance.
You can see no obstacle here.
We have a we we have a warning.
Warning and if we go closer.
Well, as you can see here, well, we don't have necessarily the minimum threshold, so you may lower
added threshold to test.
OK, because it seems that we can't reach 10 centimeters, so I'm going to stop code and we just have
one thing to change is here to knock distance.
Let's between.
And it started in.
Because for some reason, this senseor here.
But less than here, like 20, something like this, so we go down and let's see what we can get here.
Thirty one twenty, an obstacle to a lot less than 20 centimeters.
So to unlock, I can just press on the button here.
Of course, I need to move the obstacle first race on the pushbutton and I can unlock.
And as you can see, that's quite long.
OK, look at the simulation, the simulator time here is not really that fast, OK?
It's quite long to just simulate once again.
And this is because, well, we have quite a lot of code now.
This application is a little bit more complex.
So you can see the limitation of the simulation.
It's working nice, but for a more complex set up and more complex project like this, this might not
be as optimal.
So.
Well, now I can use any of the other functions.
Okay, so here this really if I increase the brightness here, you can see the energy is so if with
the luminosity the brightness is lower and then I can toggle between the different modes price on off,
I can see the luminosity from the photoresistor.
You can see date in real time almost because well the simulator is quite slow right now, OK.
And if I go back to settings I can erase it.
The settings settings have been read it go back to the distance.
I can see so I can just but inches I can reset.
The problem here, and you see it still OK?
So everything works just like we do.
We all have.