Let's finish up this section with a review of what we've done so far, what works, and then review
what we are going to do in the next section.
So right now, we've got quite a bit of functionality implemented.
We are able to manually turn the pump on and off.
Of course, we can control the pump via the actual input from the humidity sensor and we can also calibrate
the threshold for the pump.
Of course, we've got gauges that give us information about what is happening with the controller of
of course, we are monitoring visually the solubility, the real values coming out of the sensor.
But we also have gauges that tell us what is happening with the voltage that are feeding the microcontroller
and the motor and everything works quite well.
Turn on the power supply can see the voltages and voltage input is coming in good, indicating that
there's plenty of power for the components, the soil humidity.
Also gives us up to date values of what's going on with the soil humidity can control the pump manually.
So we can bypass any thresholds and finally we can set the desired threshold set, then the application
as a whole takes into account to decide when to turn on the modem or not.
OK, now.
One issue that we need to correct before we add any more functionality or complicate things further
is the fact that in our loop we use a delay.
So this is very inefficient use of the resources of a microcontroller.
So what I want to do in the next section is to replace the delay function here inside the loop with
the task scheduler will be using the tusked scheduler to essentially schedule any functionality that
we've already implemented.
For example, when to report.
Your when to put voltages in even later on.
What we'll do is we'll have a task scheduler to monitor the amount of time that the pump has been kept
in the on state so that it can automatically cut it off as some security and safety measure so we don't
flood the terrarium if the pump stays on for too long and perhaps communications with the note read
flow disrupted.
So let's continue with the next section where we could reduce the task schedule.