1
00:00:03,890 --> 00:00:04,920
Welcome back.

2
00:00:05,030 --> 00:00:12,770
In this lesson we are going to look at the final most common use of time is which host to measure the

3
00:00:12,770 --> 00:00:15,560
time between events.

4
00:00:15,560 --> 00:00:17,200
So I'm back here.

5
00:00:17,260 --> 00:00:19,720
Called six dot com.

6
00:00:19,950 --> 00:00:23,670
We've written two articles on this very topic on this side.

7
00:00:23,670 --> 00:00:30,200
So we're going to go through the articles and then we go to you vision to write a code just like we

8
00:00:30,200 --> 00:00:35,230
did for the lesson on counting events using timers.

9
00:00:35,270 --> 00:00:39,710
So just type cool takes and dot com in your browser.

10
00:00:39,970 --> 00:00:43,100
Then when you're on the Web site go to lessons

11
00:00:46,340 --> 00:00:48,000
What's that page open.

12
00:00:48,030 --> 00:00:55,340
You can go to work and with time is should be down here somewhere working with time.

13
00:00:55,370 --> 00:00:58,850
And then you can come to measuring time between events.

14
00:00:58,850 --> 00:01:03,220
So this a very short write up on the topic.

15
00:01:03,830 --> 00:01:08,970
See it's open and so yeah.

16
00:01:09,000 --> 00:01:10,670
This is summary an afterthought.

17
00:01:10,740 --> 00:01:15,700
There is a very exciting case study you would love this show.

18
00:01:15,780 --> 00:01:17,810
Let's just give this introduction here.

19
00:01:17,850 --> 00:01:18,480
What does it say.

20
00:01:18,480 --> 00:01:25,670
It says this lesson is a continuation of the previous lesson count and event in that lesson.

21
00:01:25,680 --> 00:01:33,970
We saw how we can count the occurrence of events by capturing the edges off on inputs.

22
00:01:34,050 --> 00:01:41,370
We said the microcontroller can detect the currents of an event due to the signal changes that happen.

23
00:01:41,540 --> 00:01:46,560
The input spin off the microcontroller to find the duration of an event.

24
00:01:46,560 --> 00:01:47,620
All we have to.

25
00:01:47,700 --> 00:01:55,380
All we have to do is save the timestamp of the horizon edge capture in one variable and saved it timestamp

26
00:01:55,500 --> 00:02:02,810
of the falling edge capture in another variable and then we should trust that timestamp of the rights

27
00:02:02,810 --> 00:02:11,090
and edge from the timestamp of the fallen edge finally to convert the results to our desired time units.

28
00:02:11,100 --> 00:02:21,170
We have to multiply it by an appropriate value based on the run and frequency of ICP you in our time

29
00:02:21,170 --> 00:02:22,370
of configuration.

30
00:02:22,370 --> 00:02:30,230
We have to select capture output just in order to be able to perform this task fully in the same principle

31
00:02:30,260 --> 00:02:32,900
to measure the time between two event.

32
00:02:32,930 --> 00:02:41,060
We have to save the timestamp of the right and edge capture of event one i.e. input 1 and then the timestamp

33
00:02:41,300 --> 00:02:47,410
of the rise and edge capture of event to find a difference between the two timestamps then.

34
00:02:47,660 --> 00:02:51,460
That's the difference to the appropriate time units.

35
00:02:51,470 --> 00:02:57,240
So we go to your vision and then we write the code.

36
00:02:57,440 --> 00:03:03,920
So before we go and write the code there is a perfect use case for this.

37
00:03:03,920 --> 00:03:08,420
And this is working with ultrasonic sense source.

38
00:03:08,450 --> 00:03:14,330
I don't know whether you've used ultrasonic sensors but this is how you write drivers for ultrasonic

39
00:03:14,330 --> 00:03:15,340
sensors.

40
00:03:15,350 --> 00:03:17,180
You have to detect.

41
00:03:17,180 --> 00:03:21,200
You have to measure the the occurence between two events.

42
00:03:21,230 --> 00:03:27,700
And we'll take a look at that and we would go and right that same driver in our car you vision.

43
00:03:27,950 --> 00:03:36,340
So come back to the lessons page and click over here or trust one module is on the interface and send

44
00:03:36,360 --> 00:03:37,260
source.

45
00:03:37,390 --> 00:03:42,860
You should click here and then we take a look at it.

46
00:03:42,940 --> 00:03:44,900
So yes you can take a look at that.

47
00:03:45,170 --> 00:03:47,950
But I would just continue this in the next lesson.

48
00:03:47,960 --> 00:03:49,650
So see you in the next lesson here.
