So now let me tell you a little bit about the bouncing.
Actually, whenever you close any mechanical switch, beat a Bush button, be it a rotary switch, you're
going to face some fluctuations.
So let us take this picture.
We have a switch right here and we have a bin and we have a pull up.
We've seen this topology in the previous lectures.
So right now, what's coming to the pin is actually this five volt.
There is another situation is when we close this switch.
And what's going to come to the spin is the zero coming from the ground.
OK, so we have two cases.
We have the five volt down to the pin or the zero volt.
Well, this is not the whole story.
There is another micro story that is going on here, and this micro story is working in the range of
microseconds and milliseconds.
So let us assume that this is the voltage right now and this is the time.
So this is the why is the voltage axis and the X is the time axis.
So as time goes by right here, as we can see, the five volt is coming to the pin.
OK, so we can see the waveform showing us all the five volt.
So right now, what you would expect if we close this switch is that the spin is going to read a zero
volt.
So it's like we are trying to read what's going on on the spin.
At this closing moment, we would see that we were reading five volts, we closed it and we would reach
zero volt.
Now, that is the ideal case.
But however, real life is not like that.
The moment you are going to close this switch from this, you're going to get the following waveform.
And as you can see, it's not really going to zero directly.
It's a jumping up to five again to zero, up to five again to zero.
Then it's stabilizing at zero.
Well, what's going on here?
Well, because this is a mechanical contact.
There is.
And when you try to because this is a mechanical contact, there is something bouncing in the signal
that is going to happen a few milliseconds before closing it and a few milliseconds after closing it.
So this is an electrical behavior that is going to happen when you try to get to conductive materials
to touch each other.
So the instant we start to touch these two conducting materials together, we want to be able to see
a stabilized signal immediately.
We're going to see some deep bouncing between high and low until this signal is stabilized.
So if you study any codes regarding electromagnetic in conductors and waves and conductors, you're
going to see that this phenomenon is really famous.
And, well, this is why we are studying it right now, because you could be connecting your pushbutton
and you're breathing it, but you're seeing multiple results and you could see a fluctuation in the
action that this push button is supposed to do.
Right.
This is why we are studying this phenomenon now.
We need to solve this.
We could solve it with electronics, actually, but we already have electronic ready and made like the
Adreno.
It's not really easy and handy to just add electronics components to the pen in order to avoid this
bouncing.
So there is some software solutions that we could use in order to avoid seeing these fluctuations.
So the solution is going to wait until this fluctuation is over.
We're going to monitor it.
Then we're going to say, OK, now the button is pressed.
Now, this will concern a little bit of time, a few more milliseconds before the action is taken.
But at least we will be getting rid of this noisy signal.