Let us try to modify this school says that we are able to bring the values that we have in account the
right to, we already know that there do exist an EPA which could be used to bring the current value
of attainment.
To what we will do is since to understand an auto loan to facility outside wildland.
So this will keep our zinc processing system running.
OK.
And then we know that the previous logic that we build is we are checking where the timer is expired
or not.
And then we are pretending that we will teach you a delay of five second rate.
So let me just go ahead and modify the logic of it, Rachel here.
When our timer is not expired, so whatever we write in this curly braces says this belongs to a while
Duke will be executing right?
So go ahead and add some delay first.
So usually basically allow us to generate the delay microsecond, Rachel.
Let me just add value says that we are able to get the deed in a millisecond, right?
So to get the millisecond, we need to add a thousand to three zero.
And it is do we bring the values at an interval of one hundred millisecond rate, so just died at 100?
This will give us a delay of hundred milliseconds.
So each new value that will be printing from a counter will be after an interval of 100 millisecond
because we are generating a five second rate.
So.
We'll go ahead and try to first look for a function that gives us our readiness to counter current Valerie.
So here we have a function to get the count value right, and this basically returns, you did right,
so here you could see it returns a new 32.
So we copy this.
We go ahead and let us just add you 32 and and they just leave this as a counter value, right?
And initialize it to unseat.
So while we are waiting for a timer to expire, we'll just be updating Counter-rally that.
The value that has been written by this function, right, so this required.
Instill structure as an argument, right?
So we add and Daimler here.
Right, so this what this will do is this will return the current counter-rally.
Which we will be storing in account available, and then we'll also be printing this value on a console.
Right.
So the current account value of the religious printed in a decimal format, do not forget to add a new
line character, and the variable that is holding the current account value is counter-rally.
Right?
So we'll just be adding this logic right now till the time our timer expires at an interval of hundred
millisecond rate.
So we'll just be adding a comment here just gives us a delay of a millisecond at an interval of a millisecond
will be printing the counter value, right?
So this will also give us an idea about the operation of our timer.
So whether it is going up or down.
So right now, we won't be adding any logic, right?
So here as we are too violent so far, five-second will be waiting over here in this wild loop and as
soon as our timer is expired will be coming out of a wildcard.
If you do not really deliver here, what will happen is this will be executed continuously.
Right outside also will be adding some.
So let's just call this muesli OK.
Outside the loop, OK, and here let it just died.
A delay of 500 millisecond.
Great.
So this will.
Do not overflow our system, right, so you'll get in enough time between operating of this stream,
right?
So we know that till our timer expired, this will be continuous, reprinting the account value and
as soon as our timer expired will be reaching over here and in an interval of five millisecond, we'll
be printing this stream, right?
So right now, we haven't been able to let it just go ahead and try to first execute this call just
to understand whether counter value stays at zero.
OK.
So again, copy this to statement and then add them after the deal.
Right to work.
This will do is.
This will be printing value of a timer, OK, after our timer expiring, since we disable an hour two
or more.
You'll be noticing it stays at a value of zero, right?
So let it just build our entire application project.
So our bill is finished.
Now we go ahead and again select the timer as the Blue Application Project, debug US launch on hardware.
So this will change our perspective from design to debug, right?
So we already have connected our serial terminal to call for may just be clearing up our console.
OK.
So that we get the data.
From our current execution, right, so we just need to click on this resume button.
Now, since we are not receiving anything, the good idea will be that we first met is just disconnect
our close to a minute, OK, and then again, try to connect a great deal first, let it just go ahead
and select our diva configuration and click relaunch.
So now go to a lady's terminal, click on this plus button again, connect to a serial terminal and
click on Resume button.
Right now, you could see that it is showing us the number right, so allow the timer to expire right
now if you just observe, right?
So let me just try to click on the reset button so that we able to stop an execution of a cool right.
This is the first thing that I'm doing over here, so we won't be getting any new data on the serial
console since I forcefully apply a reset.
Now, let me just try to analyze the lead, right?
So first timer and need a successful self-test is also successful.
OK, so here we have first value after an interval of 100 millisecond and you could clearly see our
value is going down with an interval of two hundred millisecond rate to eat since we are upgrading the
value at an interval of 100 millisecond.
Right.
So with each iteration, you could actually see that our counter-rally will stick.
So this confirms that our counter operates in another mode and as soon as it reaches to zero.
OK, you could see that we get the message the delay of five second issue, right?
And after that, it stays at zero.
So this could be confirmed from here.
Also that as soon as we reach this two value of zero, this would automatically reload our timer to
value that we want to.
So two that zero and this is what we refer to as a non auto reload mode or a normal mode of a timer,
right?