1
00:00:00,300 --> 00:00:05,100
Let's finish up this section with a review of what we've done so far, what works, and then review

2
00:00:05,100 --> 00:00:07,740
what we are going to do in the next section.

3
00:00:08,190 --> 00:00:12,120
So right now, we've got quite a bit of functionality implemented.

4
00:00:12,750 --> 00:00:16,830
We are able to manually turn the pump on and off.

5
00:00:17,100 --> 00:00:25,080
Of course, we can control the pump via the actual input from the humidity sensor and we can also calibrate

6
00:00:25,140 --> 00:00:26,760
the threshold for the pump.

7
00:00:27,750 --> 00:00:32,710
Of course, we've got gauges that give us information about what is happening with the controller of

8
00:00:32,780 --> 00:00:39,240
of course, we are monitoring visually the solubility, the real values coming out of the sensor.

9
00:00:39,240 --> 00:00:45,720
But we also have gauges that tell us what is happening with the voltage that are feeding the microcontroller

10
00:00:45,720 --> 00:00:49,540
and the motor and everything works quite well.

11
00:00:49,980 --> 00:00:56,610
Turn on the power supply can see the voltages and voltage input is coming in good, indicating that

12
00:00:56,610 --> 00:01:01,230
there's plenty of power for the components, the soil humidity.

13
00:01:03,120 --> 00:01:11,130
Also gives us up to date values of what's going on with the soil humidity can control the pump manually.

14
00:01:12,910 --> 00:01:22,540
So we can bypass any thresholds and finally we can set the desired threshold set, then the application

15
00:01:22,540 --> 00:01:27,400
as a whole takes into account to decide when to turn on the modem or not.

16
00:01:30,180 --> 00:01:30,960
OK, now.

17
00:01:32,310 --> 00:01:39,120
One issue that we need to correct before we add any more functionality or complicate things further

18
00:01:39,150 --> 00:01:44,560
is the fact that in our loop we use a delay.

19
00:01:45,090 --> 00:01:49,470
So this is very inefficient use of the resources of a microcontroller.

20
00:01:49,890 --> 00:01:55,380
So what I want to do in the next section is to replace the delay function here inside the loop with

21
00:01:55,380 --> 00:02:02,520
the task scheduler will be using the tusked scheduler to essentially schedule any functionality that

22
00:02:02,520 --> 00:02:03,770
we've already implemented.

23
00:02:03,780 --> 00:02:05,750
For example, when to report.

24
00:02:06,490 --> 00:02:11,470
Your when to put voltages in even later on.

25
00:02:11,490 --> 00:02:19,140
What we'll do is we'll have a task scheduler to monitor the amount of time that the pump has been kept

26
00:02:19,140 --> 00:02:27,270
in the on state so that it can automatically cut it off as some security and safety measure so we don't

27
00:02:27,270 --> 00:02:34,440
flood the terrarium if the pump stays on for too long and perhaps communications with the note read

28
00:02:34,440 --> 00:02:36,000
flow disrupted.

29
00:02:36,340 --> 00:02:41,150
So let's continue with the next section where we could reduce the task schedule.
